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

fix(fabric.Object): Cache CropX and CropY Object Properties #6924

Merged
merged 3 commits into from
Mar 10, 2021

Conversation

rileygowan
Copy link
Collaborator

@rileygowan rileygowan commented Mar 10, 2021

In response to #6907, add cropX and cropY to fabric.Image's list of cacheProperties.

/**
* cacheProperties:
* List of properties to consider when checking if cache needs refresh
* Those properties are checked by statefullCache ON ( or lazy mode if we want ) or from single
* calls to Object.set(key, value). If the key is in this list, the object is marked as dirty
* and refreshed at the next render
*/

Demo made using https://codepen.io/xh4010/pen/ZEBjrqe, but without explicitly setting dirty: true:
pug

close #6907

@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2021

Code Coverage Summary

> fabric@4.3.1 coverage:report /home/runner/work/fabric.js/fabric.js
> nyc report --reporter=lcov --reporter=text

-----------|---------|----------|---------|---------|-----------------------------------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                             
-----------|---------|----------|---------|---------|-----------------------------------------------
All files  |   82.68 |    76.91 |    85.6 |   82.45 |                                               
 fabric.js |   82.68 |    76.91 |    85.6 |   82.45 | ...,29586,29711,29791-29856,29979,30078,30295 
-----------|---------|----------|---------|---------|-----------------------------------------------

@rileygowan rileygowan added the bug label Mar 10, 2021
@asturur
Copy link
Member

asturur commented Mar 10, 2021

Thanks!

@asturur
Copy link
Member

asturur commented Mar 10, 2021

oops @rileygowan! we added it in fabric.Object, while this is specific of fabric.Image !

@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2021

Code Coverage Summary

> fabric@4.3.1 coverage:report /home/runner/work/fabric.js/fabric.js
> nyc report --reporter=lcov --reporter=text

-----------|---------|----------|---------|---------|-----------------------------------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                             
-----------|---------|----------|---------|---------|-----------------------------------------------
All files  |   82.68 |     76.9 |    85.6 |   82.45 |                                               
 fabric.js |   82.68 |     76.9 |    85.6 |   82.45 | ...,29595,29720,29800-29865,29988,30087,30304 
-----------|---------|----------|---------|---------|-----------------------------------------------

@asturur
Copy link
Member

asturur commented Mar 10, 2021

Thank you!

@asturur asturur merged commit 2eabc92 into master Mar 10, 2021
jameszhong2008 added a commit to jameszhong2008/fabric.js that referenced this pull request Mar 21, 2021
fix(fabric.Image): Cache CropX and CropY cache properties (fabricjs#6924)
@asturur asturur mentioned this pull request Apr 7, 2021
@asturur asturur deleted the 6907/cache-crop-properties branch February 4, 2022 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modify the cropX cropY parameter that contains the clipPath object, it not be updated after canvas.renderAll()
2 participants