Adjusted position and size of images #306

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants

Hi,

It seemed to me that images (when created via 'fromElement') where not placed correctly. Also the given sizes where ignored. Therefore I adjusted the corresponding parts.

Cheers,
Frank

Owner

kangax commented Nov 5, 2012

Do you have a test case showing images positioned wrong?

have a look at this side by side comparison:
current implementation: http://jsfiddle.net/gr6mr/1/
adjusted implementation: http://jsfiddle.net/gr6mr/2/

the adjustments apply to http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute (without support for slice)

How come the options are dropped here?

Owner

franatique replied Nov 14, 2012

options may contain with or height values wich will override the values from the image tag. This is unwanted because the image width and and height are needed for positioning and stretching.

Owner

kangax commented Nov 14, 2012

@franatique Looks good, thanks! I'll check if all existing tests still pass and merge this in. Would be good to also move your comparison test into our suite.

Owner

kangax commented Nov 14, 2012

One more thing: shouldn't we also use "preserveAspectRatio" in fabric.Image#toSVG?

you're right. I'll take care of it.

Owner

kangax commented Jan 21, 2013

Need to integrate this with newly added originX/originY properties, and with new master.

@kangax kangax closed this Jan 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment