Proper way for displaying image in Embedded component

Hi everybody !

Im stuck with the strange problem - I need to display a document viewer in page by page basis. Server component generates PNG image for the requested page, according to current scale, e.g. providing final image file as a StreamResource to the Embedded component, which is placed in a panel and displayed in a modal window.

The problem is when I adjust the page zoom and server generate a larger image - I do not see any scrollbars in a panel and it is impossible to scroll an image. However, the modal window itself shows the scrollbar (but only a vertical one) scrolling entire viewer contents - panel with the image and the toolbar. Am I doing anything wrong ?

The layout of UI components is as follows:

  • Modal window with a VerticalLayout
    • Viewer components that is a VerticalLayout with:
      • HorizintalLayout with toolbar buttons
      • Panel (style light) with an Embedded component inside (Embedded component is initialized with null’ed width and height)
      • setExpandratio(panel, 1.0f) is set

When image needs to be changed (eg, zoom change or page up/page down button clicked), image is changed by setting a new source to the embedded component via setSource(…)