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

fabric.Path is not drawn on canvas #3859

Closed
pavloKozlov opened this issue Apr 21, 2017 · 12 comments · Fixed by #3870
Closed

fabric.Path is not drawn on canvas #3859

pavloKozlov opened this issue Apr 21, 2017 · 12 comments · Fixed by #3870

Comments

@pavloKozlov
Copy link

I use an example from fabric introduction page http://fabricjs.com/fabric-intro-part-1

Version

1.7.0 and higher

Test Case

http://jsfiddle.net/4ycgsovr/

Steps to reproduce

var canvas = new fabric.Canvas('c');
var path = new fabric.Path('M 0 0 L 300 100 L 100 300 z', {originX: 0, originY: 0});
canvas.add(path);

Expected Behavior

svg path is drawn on canvas:
http://jsfiddle.net/bnz4osxv/
this jsfiddle uses fabric version 1.6.7

Actual Behavior

svg path is not visible

@asturur
Copy link
Member

asturur commented Apr 21, 2017

i m able to see the path with both fiddles.

@pavloKozlov
Copy link
Author

Looks like it's a problem with default color.
If you set fill to fabric.Path, it renders ok.
But without fill you will able to see path only when select it as invisible on canvas and then resize.
screenshot from 2017-04-21 16-23-02

@asturur
Copy link
Member

asturur commented Apr 21, 2017

on what browser are you?

@pavloKozlov
Copy link
Author

Google Chrome version 57.0.2987.133 (64-bit) and Firefox 52.0.2 on Ubuntu 16.
I have also tried in on Windows with Chrome 57 and Firefox.
The same result for all these browsers.

@asturur
Copy link
Member

asturur commented Apr 21, 2017

is see them perfectly on both fiddles. chrome 58 on macosx

@p3ndu
Copy link

p3ndu commented Apr 21, 2017

Hi,

I can confirm that this bug reproduces on Chrome Version 57.0.2987.110 (64-bit) / Firefox 45.2.0 on CentOS 6.8.

@pavloKozlov
Copy link
Author

I can confirm that on MacOS with Chrome 57 it works ok.

@ncou
Copy link
Collaborator

ncou commented Apr 21, 2017

There is the same behaviors in the Chrome version 57.0.2987.113

If i add one of those properties the shape is draw :

  • fill: 'none'
    or
    -strokeWidth:0

@asturur
Copy link
Member

asturur commented Apr 21, 2017

a linux bug? i do not have a vm here to test.

@pavloKozlov
Copy link
Author

It also reproduses on Windows.

@asturur
Copy link
Member

asturur commented Apr 23, 2017

i see on windows edge does not work ( i m on a VM ) if you rescale it then it works.

@asturur
Copy link
Member

asturur commented Apr 23, 2017

ok i got it :D
There was a small fundamental design flaw in the cache.
The object gets initializated at status dirty: false.
If nothing change before first rendering, it does not draw anything.

on my macbook worked because adding to a retina enabled canvas after initialization, doubled the cache dimensions and a redraw was triggered.

i m fixing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants