Fabric.js: Canvas updates itself only on "mouseup"

Created on 18 Sep 2017  路  2Comments  路  Source: fabricjs/fabric.js

Version

1.7.19

Test Case

https://jsfiddle.net/qejsvc5o/1/

Steps to reproduce

Move red rectangle, then try to scale down red rectangle.

Expected Behavior

I want black rectangle to fill the gap between red rectangle and top canvas border. It works correctly when I move red rect:

moving

It should work in the same way for scaling red rectangle down. Once red rectangle is resized then black rectangle should immediately fill the gap.

Actual Behavior

The correct result is showed only after mouseup. During mousedowncalculations are broken.

resizing

backport to 1.x bug

All 2 comments

Hi,

It's a cache problem
Fix : https://jsfiddle.net/qejsvc5o/2/

You do not need to disable caching to make it work.
https://jsfiddle.net/qejsvc5o/3/

The point is that there is a bug indeed, the scaling action of red is blocking cache refresh of black.

Is also true that using caching for this kind of actions is pointless, disabling cache may be ok if the design has many elements and all updating togheter.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

medialwerk picture medialwerk  路  5Comments

amancqlsys picture amancqlsys  路  5Comments

AbhijitParate picture AbhijitParate  路  3Comments

lyzs90 picture lyzs90  路  3Comments

bevacqua picture bevacqua  路  4Comments