Giter Club home page Giter Club logo

bitmapscroller's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bitmapscroller's Issues

BitmapDataCollection code optimisation and other suggestions.

In sampleBitmapData, Rectangle clone() call can be inlined. If BitmapData size doesn't change, no need to create a new instance each time as it results in lots of garbage collection/memory allocation in an oscillating manner. Just remember to lock the BitmapData prior to setting pixels during the sample() loop. If one needs to account for different BitmapData dimensions for differnet orientations/states, consider creating a fixed size to account for all possible sizes, or ~2 set sizes.

Instead of recursely calling sample() which involves calling the costly calculateCollectionStartIndex() method, consider the possibility of using a while loop and an incrementing index. Another way is to precalculating the start index once (outside the sample() function.) and increment the index on each iteration.

Furthermore, inline whenever possible. Ever considered using Haxe for inlining and the possibility of writing directly to memory through Alchemy ? (even though that's more suited for per-pixel drawing/vector buffer). This could improve the performance by a certain degree..

Scroll-wise, a drag toss effect might be better as the scrolling is too fast now given the mouse-to-screen/totalScrollWidth ratio. Elastic snapping to the edges of the nearest indexed item would be a great touch.

Small bug with collectionRects

I'm using BitmapScroller and I love it. But with the rescaling of the browserwindow I want to redraw all the bitmaps to the appropriate size (full-window-size) so I'm setting the 'bitmapDataCollection = <NEW_ARRAY_WITH_BITMAPS>'. This works fine except for the rectangles staying the same sizes.

Proposal:
In the function 'indexCollection', before the loop, the collectionRects-array need to be reset:

collectionRects = [];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.