summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorSilenio Quarti2011-11-09 10:55:11 (EST)
committer Carolyn MacLeod2011-11-09 10:55:11 (EST)
commit84b7f4eb839c40c67c06cf1cb3c34b24bf589c5a (patch)
tree9988bdf536c1fc3d1142ea12a4857e7ed711c753
parent943d6b15e034a4b2ef199037f7b7331f92620fef (diff)
downloadeclipse.platform.swt-84b7f4eb839c40c67c06cf1cb3c34b24bf589c5a.zip
eclipse.platform.swt-84b7f4eb839c40c67c06cf1cb3c34b24bf589c5a.tar.gz
eclipse.platform.swt-84b7f4eb839c40c67c06cf1cb3c34b24bf589c5a.tar.bz2
Bug 362999 - SWTGraphics#scale is broken when used with Printer on
Eclipse 3.7 / GTK
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java2
3 files changed, 7 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
index 0b79f2d..b43afa6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
@@ -457,6 +457,9 @@ public int /*long*/ internal_new_GC(GCData data) {
double printY = OS.gtk_page_setup_get_top_margin(pageSetup, OS.GTK_UNIT_POINTS);
Cairo.cairo_translate(cairo, printX, printY);
Cairo.cairo_scale(cairo, screenDPI.x / (float)dpi.x, screenDPI.y / (float)dpi.y);
+ double[] matrix = new double[6];
+ Cairo.cairo_get_matrix(cairo, matrix);
+ data.identity = matrix;
data.cairo = cairo;
isGCCreated = true;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
index cd51b3b..08e999a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
@@ -2792,6 +2792,9 @@ double[] identity() {
} else {
Cairo.cairo_matrix_init_identity(identity);
}
+ if (data.identity != null) {
+ Cairo.cairo_matrix_multiply(identity, data.identity, identity);
+ }
return identity;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java
index d507acb..b42a96d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java
@@ -54,7 +54,7 @@ public final class GCData {
public int /*long*/ cairo;
public double cairoXoffset, cairoYoffset;
public boolean disposeCairo;
- public double[] clippingTransform;
+ public double[] identity, clippingTransform;
public String string;
public int stringWidth = -1;
public int stringHeight = -1;