Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327267 - GraphicsSVG ignores scaling of SVG images
Summary: GraphicsSVG ignores scaling of SVG images
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 2.3   Edit
Hardware: PC Windows XP
: P3 normal
Target Milestone: 1.11.0   Edit
Assignee: Alex Boyko CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 465575
  Show dependency tree
 
Reported: 2010-10-07 14:47 EDT by Alex Boyko CLA
Modified: 2017-06-19 06:53 EDT (History)
3 users (show)

See Also:


Attachments
Patch that corrects the issue (1.30 KB, patch)
2017-02-09 04:14 EST, Ansgar Radermacher CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Boyko CLA 2010-10-07 14:47:21 EDT
1. Create a diagram with a few SVG images on it
2. Resize SVG image based shapes such that SVG image becomes larger/smaller
3. Export the diagram to SVG (RenderedScaledGrsaphics must be used during the export)

Actual: Note that SVG images will have original size.
Expected: SVG images should scaled as they are on the diagram

GraphicsSVG doesn't scale SVG images. Hence, either GraphicsSVG should scale the SVG images or scale factor inserted in the SVG DOM document.
Comment 1 Ansgar Radermacher CLA 2017-02-09 03:45:37 EST
SVG images are wrongly scaled during export. This can also be reproduced in 465575.

Analysis:
GMF uses a graphics wrapper which could either be RenderedScaledGraphics or (Rendered)MapModeGraphics.
These wrappers delegate to GraphicsSWT, GraphicsSVG depending on whether you are exporting or inside the editor. The problem is that the class RenderHelper makes an instanceof DrawableRenderedImage test to differentiate whether it deals with the graphics wrapper from GMF or the device specific graphics. However, unlike GraphicsSWT, GraphicsSVG also implements this interface and thus wrongly delegates directly to it without applying scaling first. I´ll add a patch that fixes the problem
Comment 2 Ansgar Radermacher CLA 2017-02-09 04:14:00 EST
Created attachment 266739 [details]
Patch that corrects the issue
Comment 3 Pierre-Charles David CLA 2017-02-14 05:48:04 EST
Patch applied as 4d9ab970b2ae92907570628393aa0738b470706b.