Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic SVG Rendering Issue (Read 2578 times)
mortenf
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Jan 7th, 2011
SVG Rendering Issue
Jan 7th, 2011 at 9:30am
Print Post  
Hi,

I am trying to make the selection hit-test work against the actual outline of the SVG graphics of my nodes, rather than the default rectangle.

From my understanding, setting the Shape property of my SVG node to Shape.FromSvg(node.Content) should make this happen.

And it appears to work! So far, so good!

BUT: After setting the Shape property as described above, the rendering of my SVG graphics gets very ugly!



In the image, Node-2 is rendered with the default shape (Rectangle) while Node-1 is rendered with node.Shape = Shape.FromSvg(node.Content).

Q-1: Is this the correct approach for making selection hit-testing respect the SVG outline?
Q-2: Any suggestions for how to make the graphics look correct even with outline hit-testing?

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SVG Rendering Issue
Reply #1 - Jan 7th, 2011 at 12:44pm
Print Post  
Hi,

That's very cunning idea 8) Problem is Shape.FromSvg creates a convex-hull approximation based only the SVG element coordinates, but not on their stroke width, and then SvgNode sets its shape as graphics clip region when rendering. Perhaps it is easiest to fix this on our side by not setting clip region if the SvgNode.Transparent property is enabled. It is set to true in your case, right?

Stoyan
  
Back to top
 
IP Logged
 
mortenf
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Jan 7th, 2011
Re: SVG Rendering Issue
Reply #2 - Jan 7th, 2011 at 1:13pm
Print Post  
Yes, node.Transparent is set to 'true'.

Maybe it is possible to set a simpler clipping region (like the original rectangle) while still using the outline for hit-testing?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SVG Rendering Issue
Reply #3 - Jan 10th, 2011 at 1:21pm
Print Post  
Hi,

Check the build from the PM page; it should not clip the SVG drawing now. Incidentally our developers have recently added support for some missing SVG elements (e.g. text and marker) for the next release, but we haven't tested it much yet. Please let us know if you see any problems.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
mortenf
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Jan 7th, 2011
Re: SVG Rendering Issue
Reply #4 - Jan 20th, 2011 at 10:11am
Print Post  
Thanks. Looks like its working. Any ETA when this will be in an official release?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SVG Rendering Issue
Reply #5 - Jan 20th, 2011 at 11:09am
Print Post  
We should release it by mid-February.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint