Thomas DeWeese wrote:
> Jorg Heymans wrote:
>>>> The funny thing is that the component is redrawn correctly first but
>>>> then everything disappears immediately afer. I'll have a look at
>>>> that method, thanks.
>> Well i can "correct" the behaviour by setting a correct viewbox first
>> before i start manipulating the document. The viewbox is set
>> dynamically before any other manipulation, so this could be where the
>> problem lays.
> I don't think I follow what works and what doesn't. In the working
> case you set the viewBox before building the GVT tree? Or is it just
> where in the dynamic case that you set the viewBox?
> If you can summarize working/non-working cases I might have
> suggestions on what could be the problem.
The situation :
upon application start a static svg is loaded from the filesystem. This
is nothing more then a colored rect, the root element has viewbox like 0
0 800 600
What i am doing :
upon rect-click, retrieve path elements from server and add them to the
document for display. The path elements have coordinates in a specific
viewbox, this viewbox is transmitted from the server as well. Before i
add the elements i modify the viewBox attr of the root element with the
When i now resize the canvas the path elements briefly show the correct
new position, then the canvas shows nothing anymore.
What does work :
- if i set the correct viewbox in the static svg already, then the
canvas still shows my path elements after resize. Note that i still
replace the viewbox attribute in the document, i just replace with an
identical viewbox so there are no real changes.
What does not work :
- set viewbox (ie change it), then add elements