Jump to content

Recommended Posts

Posted

Good morning, I need suggestion to solve my problem. In the testcase attached I've got a svg image embedded in a hmtframe. I put the svg source also in a label at the center of the form.

I would like the svg to draw entirely within its parent and most important to resize accordingly to the user resizing the browser window.

Any suggestions?

Thank you and stay safe.

Augusto

TestCaseImageResizing.zip

Posted

Hi everybody. From the example above, would it be possible to redraw the svg into the htmlframe when the browser window is resized? I guess to reassign svg's viewBox accordingly to the new dimension of its container.

is it doable?

Thank you

Posted
3 hours ago, augusto.pellis said:

Hi everybody. From the example above, would it be possible to redraw the svg into the htmlframe when the browser window is resized? I guess to reassign svg's viewBox accordingly to the new dimension of its container.

is it doable?

Hi,

One possible solution I think.

UniHTMLFrame1.ClientEvents.ExtEvents ->

function afterupdatehtml(sender, eOpts)
{
    if (sender.getEl().down('svg')) {
        sender.getEl().down('svg').el.dom.setAttribute('width', sender.getWidth()+'px');
        sender.getEl().down('svg').el.dom.setAttribute('height', sender.getHeight()+'px');
    }
}

UniHTMLFrame1.ClientEvents.ExtEvents ->

function resize(sender, width, height, oldWidth, oldHeight, eOpts)
{
    if (sender.getEl().down('svg')) {
        sender.getEl().down('svg').el.dom.setAttribute('width', width+'px');
        sender.getEl().down('svg').el.dom.setAttribute('height', height+'px');
    }
}

 

  • Like 2
Posted

About this topic I have a strange behaviour. If I set 4 copied/pasted panels in a container hbox'ed (Imean the same exact panel with same html, ext events) only the first one gets resized correctly. What do I wrong this time? :-( I attach screenshot of the container with the four panels in a row.

Mr. Sherzod I need your advice, again!

AnyDesk_2020-03-31_09-02-35.png

Posted

By creating the test case I've been using a generic svg and it works as expected. By using the svg's my designer created, then the problem arise. I guess it's something about the svg elements, then. I will contact the svg designer, then! 

Thank you!!!

Posted
1 hour ago, augusto.pellis said:

If interesting for anyone, the issue was the SVG having the same field id set with the same value. That created the not resizing issue.

Yes.

So is everything working as it should?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...