Discussion:
Image resizing
(too old to reply)
Werner Thie
2016-04-22 00:50:21 UTC
Permalink
Hi all

I'm stumped, cant wrap my head around this:

http://tinyurl.com/hxlpkll

I expected the image to grow to the size of the framer container, but
instead the framer is sized down to the image.

Is it possible to achieve such a setup where the contained image is
resized without resorting to resize listeners doing setHeight/setWidth
calls?

As a side note, why does the log show the warning

ImageLoader: Not recognized format of external image
'http://fabricjs.com/assets/17.svg'!

as svg seems to be a recognized image format which the browsers
understand quite nicely

I'm grateful for any hint!

Thxs, Werner
slah
2016-04-22 10:14:24 UTC
Permalink
Hello,
changed Layout from Grow to HBox and adding an appearOnce listener to
framer, gives this:
http://tinyurl.com/hsj38c6

hope it helps



--
View this message in context: http://qooxdoo.678.n2.nabble.com/Image-resizing-tp7588283p7588284.html
Sent from the qooxdoo mailing list archive at Nabble.com.
Werner Thie
2016-04-22 17:33:32 UTC
Permalink
Thank you so much, but the idea is to have the SVG maxing the drawing
area like other elements do without resorting to listeners.

What irks me is the problem, that an image in a container imposes on its
parent, which is contrary to the behavior of other elements, as it can
be easily seen by adding a button or a text area instead of an image.

http://tinyurl.com/zvmnxuy

I faintly remember when I believe it was thron revamped the image class
slightly that such a feat would be possible. I wouldn't mind having two
distinct Image classes available, one with the old behavior and the
other one behaving as a 'normal' container.

Werner
Post by slah
Hello,
changed Layout from Grow to HBox and adding an appearOnce listener to
http://tinyurl.com/hsj38c6
hope it helps
--
View this message in context: http://qooxdoo.678.n2.nabble.com/Image-resizing-tp7588283p7588284.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
qooxdoo-devel mailing list
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Werner Thie
2016-04-22 22:55:44 UTC
Permalink
Post by Werner Thie
Thank you so much, but the idea is to have the SVG maxing the drawing
area like other elements do without resorting to listeners.
What irks me is the problem, that an image in a container imposes on its
parent, which is contrary to the behavior of other elements, as it can
be easily seen by adding a button or a text area instead of an image.
http://tinyurl.com/zvmnxuy
I faintly remember when I believe it was thron revamped the image class
slightly that such a feat would be possible. I wouldn't mind having two
distinct Image classes available, one with the old behavior and the
other one behaving as a 'normal' container.
Werner
Answering my own post for the sake of completeness:

http://tinyurl.com/zwp9zj4

I decided to dig into the layout code and found my solution:

- the imposing part is handled by straddling the _computeSizeHint() function

- the resizing part then is handled by the renderLayout() function,
which simply sets the child size to the available width/height. The SVG
image retains its aspect ratio, leading to a nicely scaling image in the
drawing area.

Thxs for listening, Werner

Loading...