Canvas resize while using Flexbox

I am having a problem with resizing the coordinate system of a canvas when using Flexbox and Enyo. See the example at: http://jsfiddle.net/g7MLS/1989/

(I'm actually using Enyo 2.5 in the project. I couldn't figure out how to do jsfiddle with 2.5.)

When you first run it, everything is fine. Shrink the width of the box and the line of text stays 1 line until the canvas gets to min-width, then the text starts to wrap.

To see the problem, uncomment the lines:

c.width = b.width;
c.height = b.height;

Flexbox appears to now be using the internal coordinate width to arrange things...or something. The text will now start wrapping before the canvas shrinks to min-width.

I can't duplicate the exact setup without Enyo, but this is close and doesn't seem to do the same thing: https://jsfiddle.net/ez6b2q8v/103/

The way I understand it, setting the canvas width/height should only affect the internal coordinates, not the size of the canvas itself. What am I missing?

Comments

  • The problem was that I am using a splitter-type control on this controls parent and another control. The splitter was not calling resize() when it was moved.

Sign In or Register to comment.