Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 246315 Details for
Bug 442268
SVG images not properly displayed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Correctly formatted patch
0001-Scaling-properly-SVG.patch (text/plain), 2.65 KB, created by
Emmanuel Billaud
on 2014-08-25 10:32:23 EDT
(
hide
)
Description:
Correctly formatted patch
Filename:
MIME Type:
Creator:
Emmanuel Billaud
Created:
2014-08-25 10:32:23 EDT
Size:
2.65 KB
patch
obsolete
>From 5539e7e500e8b6b2c986bcef6753a9657080fe43 Mon Sep 17 00:00:00 2001 >From: Emmanuel Billaud <billaud.emmanuel@gmail.com> >Date: Mon, 25 Aug 2014 16:23:08 +0200 >Subject: [PATCH] Scaling properly SVG > >--- > .../tools/api/figure/AbstractCachedSVGFigure.java | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) > >diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/AbstractCachedSVGFigure.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/AbstractCachedSVGFigure.java >index 29198de..e62f015 100644 >--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/AbstractCachedSVGFigure.java >+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/AbstractCachedSVGFigure.java >@@ -103,16 +103,20 @@ public abstract class AbstractCachedSVGFigure extends SVGFigure implements Style > TransparentFigureGraphicsModifier modifier = new TransparentFigureGraphicsModifier(this, graphics); > modifier.pushState(); > >- Rectangle r = getClientArea(); >- Image image = getCachedImage(getKey() + getContextKey(graphics), r, graphics); >+ Rectangle svgArea = getClientArea(); >+ Rectangle scaledArea = new Rectangle(svgArea); >+ scaledArea.performScale(graphics.getAbsoluteScale()); >+ Image image = getCachedImage(getKey() + getContextKey(graphics, scaledArea), scaledArea, graphics); > // Draw the image > if (image != null) { >- graphics.drawImage(image, r.x, r.y); >+ graphics.drawImage(image, // >+ 0, 0, scaledArea.width, scaledArea.height, // >+ svgArea.x, svgArea.y, svgArea.width, svgArea.height); > } > modifier.popState(); > } > >- private String getContextKey(Graphics graphics) { >+ private String getContextKey(Graphics graphics, Rectangle scaledArea) { > // CHECKSTYLE:OFF > int aaText = SWT.DEFAULT; > try { >@@ -125,10 +129,9 @@ public abstract class AbstractCachedSVGFigure extends SVGFigure implements Style > StringBuilder result = new StringBuilder(); > result.append(aaText); > result.append(SEPARATOR); >- Rectangle r = getClientArea(); >- result.append(getSpecifyCanvasWidth() ? r.width : -1); >+ result.append(getSpecifyCanvasWidth() ? scaledArea.width : -1); > result.append(SEPARATOR); >- result.append(getSpecifyCanvasHeight() ? r.height : -1); >+ result.append(getSpecifyCanvasHeight() ? scaledArea.height : -1); > > return result.toString(); > } >-- >1.7.9.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 442268
:
246207
| 246315