libFMap_patch_bug_776_labelling_dgn.txt

Francisco José Peñarrubia, 07/02/2012 11:44 PM

Download (2.02 KB)

 
1
Index: src/com/iver/cit/gvsig/fmap/core/symbols/SimpleTextSymbol.java
2
===================================================================
3
--- src/com/iver/cit/gvsig/fmap/core/symbols/SimpleTextSymbol.java	(revision 38069)
4
+++ src/com/iver/cit/gvsig/fmap/core/symbols/SimpleTextSymbol.java	(working copy)
5
@@ -112,7 +112,8 @@
6
 		// Para chino hay que escoger una fuente como esta (SimSun)
7
 //		g.setFont(new Font("SimSun",Font.PLAIN, 12));
8
 
9
-		g.drawString(getText(), -((int) bounds.getWidth()/2), 0); //(int)-bounds.getY());
10
+//		g.drawString(getText(), -((int) bounds.getWidth()/2), 0); //(int)-bounds.getY());
11
+		g.drawString(getText(), 0, 0);
12
 //		g.drawRect(0, 0, 5, 5);
13
 		g.rotate(-rotation);
14
 		g.translate(-shpX, -shpY);
15
@@ -148,9 +149,9 @@
16
 		//Only for debugging purpose
17
 //		g.drawRect((int)r.getX(), (int)r.getY(), (int)r.getWidth(), (int)r.getHeight());
18
 		if (properties==null)
19
-			draw(g, null, new FPoint2D(r.getX(), r.getY()), null);
20
+			draw(g, null, new FPoint2D(r.getX(), r.getY() + r.height), null);
21
 		else
22
-			print(g, new AffineTransform(), new FPoint2D(r.getX(), r.getY()), properties);
23
+			print(g, new AffineTransform(), new FPoint2D(r.getX(), r.getY() + r.getHeight()), properties);
24
 
25
 	}
26
 
27
Index: src/com/iver/cit/gvsig/fmap/rendering/styling/labeling/LabelClass.java
28
===================================================================
29
--- src/com/iver/cit/gvsig/fmap/rendering/styling/labeling/LabelClass.java	(revision 38069)
30
+++ src/com/iver/cit/gvsig/fmap/rendering/styling/labeling/LabelClass.java	(working copy)
31
@@ -452,10 +452,11 @@
32
 					int height = (int) Math.round(xy[1] - y) ;
33
 
34
 					Rectangle textRect = new Rectangle(x, y, width, height);
35
-					Shape oldClip = graphics.getClip();
36
-					graphics.setClip(textRect);
37
+//					Shape oldClip = graphics.getClip();
38
+//					graphics.setClip(textRect);
39
 					getTextSymbol().drawInsideRectangle(graphics, null, textRect, null);
40
-					graphics.setClip(oldClip);
41
+//					graphics.setClip(oldClip);
42
+//					graphics.draw(textRect);
43
 				}
44
 			}
45
 		} else {