Canvas items not correctly drawn

Hi all,
I have the following to draw a canvas with some objects inside and I'm using the SideBar Extension (this one). When I run the Companion, the app starts with a 'welcome' tab, while the canvas is in another SideBar's tab. When I change tab to visualize the canvas, it shows a strange result. I suppose that the app has no time to draw correctly all the canvas items. If this is the case, may be I should use the Procedure component with Result but I don't know how. Is that the right way to be sure that all the canvas has completed its internal drawing? Thanks



It should be:

Possibly just timing.

Try with a clock timer (250ms or 500ms) and call the clock after procedure JS_Set, and put everything currently after JS_Set in the clock timer event, also stopping the clock.

Nope. Same issue. Tried 1000 as Interval also.

Also use a clock before JS_set
Taifun

Is your canvas size fixed or variable (fillparent/automatic), or ...?

Does the canvas setup OK if you do not open it from the sidebar?

These blocks work for me on a canvas 300x300

image

The canvas is correctly drawn if the app SideBar starts with the active tab (the first one that appear on screen at startup) with the canvas inside (third shot in my first post). Otherwise, opening the canvas tab after swiping the SideBar and selecting its tab, the canvas items are wrong.

Is this a different real screen or a virtual screen ? Not sure what you mean by tabs ?

what happens if you

Taifun

I see that the canvas is a fixed size in pixels, so you do not need to do any calculations, just enter the numbers like I did.

I just added the sidebar extension. Could be that this is causing the problem. With blocks like this it all works

Thanks all. Finally, a dedicated clock is the solution. It works for me inthe following way, so the Canvas VerticalArrangement is created at startup (visible for clock Interval = 500) and then hided by the Main screen (VerticalArrangement VA1).

image

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.