Giter Site home page Giter Site logo

Comments (3)

phpony avatar phpony commented on June 15, 2024

So I've resized all images to my size with this command:

cd /home/user/.cache/com.github.tkashkin.gamehub/graphics
find . -iname "*.jpg" -print0 | xargs -I{} -0 mogrify  -resize 392x220^ -gravity center -extent 392x220 {}

And now scrolling is not stuttering, but covers are still not "instantly" shown. There's still a delay of 1-2 sec after them appear on screen.

Probably should try to replace this to always true and try to compile my very own build:

row.icon_is_visible = !is_before_viewport && !is_after_viewport;

from gamehub.

phpony avatar phpony commented on June 15, 2024

Wrong file but yep. Changing this:

card.image_is_visible = !is_before_viewport && !is_after_viewport;

To this:

card.image_is_visible =true;

Fixes everything. No stutters, fast scrolling. Probably a bit of memory eaten and first start is slow, but overall that's what I've wanted.

For my opinion, there's another "cache" folder required with properly resized images for current grid dimensions in it. Changing display settings should wipe this folder and re-create new thumbnails. And so there should be no icon_is_visible control at all and no image processing on each start/load/scroll event. Just simple "load from cache => draw all at once".

from gamehub.

phpony avatar phpony commented on June 15, 2024

Combining code patch with approach:

find ~/.cache/com.github.tkashkin.gamehub/graphics/games/ -iwholename "*/images/*.jpg"  -print0 | xargs -I{} -0 mogrify  -resize 392x220^ -gravity center -extent 392x220 {}

made GameHub blazing fast. Fast start, smooth scroll. So probably caching of resized images and drawing all cards at once is a good idea.

from gamehub.

Related Issues (20)

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.