Textfield internal size

  • Hi Klaus
    Textfield is not updating it's size when adding image of 100% width in html every time. Seams height of added image is not calculated fast enough (due to 100% width some prop value for height must be calculated and seams taking some time. Long enough not to register new texfield height increase)

    Tried changing bgborder with delayedcall and it is working but not 100%. Specially when it is not visible it is not updating. So making it visible, then changing bgborder is almost ok but resizing is so obvious. And as sad before not 100% every time working.

    Can we get kind of command to trigger internal textfield resize even when not visible? Or other tricks to trigger recalculation of the size?
    Example:
    layer[texfield_name].resize(); *rolleyes*
    or
    rebuild(layer[textfield_name]);

    Umalo

  • I'm not sure if you mean this, but yesterday I came across a similar issue, I had an autowidth text layer, and once I resize it dynamically The text or content inside did not react, even wordwrap was set. The problem was that no real width was set to my layer. so I decide to make something which seems very obvious but it worked :

    Code
    set(layer[myLayer].onautosized, 
       copy(myLayerWidth, layer[myLayer].width);
       copy(layer[myLayer].width, myLayerWidth);
    );
  • Exactly. Instead of tweaking textfield attributes, bgborder, height, width.... I propose Klaus make textfield internal action which we can call e.g. on resize or when html changed being sure textfield will be recalculating its size.

  • Hi,

    Quote

    I propose Klaus make textfield internal action which we can call e.g. on resize or when html changed being sure textfield will be recalculating its size.

    Okay, I will consider that.

    In the meantime you could try this:

    Code
    set(layer[name].forceresize, true);
    layer[name].updatepos();

    Best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!