Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add image optimizations #325

Merged
merged 3 commits into from
Nov 24, 2020
Merged

Add image optimizations #325

merged 3 commits into from
Nov 24, 2020

Conversation

Jack-Byrne
Copy link
Collaborator

Fixes #293

Adds some optimizations to the image component.

  1. Adds shouldComponentUpdate lifecycle method. This should prevent images from unneccesarily updating when no props have changed. This especially helps with template images since it prevents the canvas from being redrawn unnecessarily.

  2. Storing calculated canvas style properties. This point more-so addresses the issue in Tile images broken on Safari #293. For some unknown reason on Safari 14, the calculated canvas height kept growing causing images to shift downward. The calculated styles for the canvas are now only calculated once and stored.

src/js/Templates/Shared/Image.js Outdated Show resolved Hide resolved
src/js/Templates/Shared/Image.js Outdated Show resolved Hide resolved
Co-authored-by: Collin <iCollin@users.noreply.github.com>
@Jack-Byrne Jack-Byrne merged commit 01ed2ee into develop Nov 24, 2020
@Jack-Byrne Jack-Byrne deleted the fix/image_optimizations branch November 24, 2020 21:13
@iCollin iCollin mentioned this pull request Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants