summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorSilenio Quarti2011-11-09 10:55:11 (EST)
committer Carolyn MacLeod2011-11-07 12:04:45 (EST)
commitda1f7fdabbd2b4b4a76e6e27218cef07f95be1ce (patch)
tree893f6171035a51717183e4d7cb7a70312e27e102
parent27e2f8ce85090d34baca4d5431850946323e34c7 (diff)
downloadeclipse.platform.swt-da1f7fdabbd2b4b4a76e6e27218cef07f95be1ce.zip
eclipse.platform.swt-da1f7fdabbd2b4b4a76e6e27218cef07f95be1ce.tar.gz
eclipse.platform.swt-da1f7fdabbd2b4b4a76e6e27218cef07f95be1ce.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;