Jorg Heymans wrote:
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
new viewBox.
When i now resize the canvas the path elements briefly show the correct
new position, then the canvas shows nothing anymore.
Ok, I think I know what is happening. The canvas 'caches' a
copy of the viewingTransform so it doesn't have to go into the
UpdateManagerThread to access it everytime. The problem is that
when you change the viewBox this copy is now invalid.
Then when it goes to updateRenderingTransform it get's a bit confused.
Probably the best way to work around this problem would be for you
to create a new SVG element rather than update the root SVG element.
This can be done by simply creating the element:
<svg x="0" y="0" width="100%" height="100%" viewBox="# # # #">
and appending your new content under it.
I'm trying to think of good solutions to the underlying problem.
Can you give me a ball park figure for the 'updated' viewBox coords?
I'd like try and produce a simple standalone example of the problem.
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
I hope this clarifies my situation.
Regards
Jorg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]