Hi everyone,

We are using the TTFMarkFactory class for dynamic point symbolizers. It is 
working great for radially symmetrical shapes, but setting arbitrary offset 
does not seem to be possible (e.g. for a symbol which acts as a pointer). 
Usually this would be achieved by transparent pixels.

See the patch below how we solved the problem. Could this feature be enabled in 
the GeoTools?

Regards,
Sakke Puhakka



--- ./TTFMarkFactory.java       2014-01-09 12:04:36.833571700 +0200
+++ ./TTFMarkFactory2.java      2014-01-09 12:05:55.643571700 +0200
@@ -117,8 +117,9 @@
         // but the fonts ones are flipped to compensate for the fact the y 
coords grow from top
         // to bottom on the screen. We have to flip the symbol so that it 
conforms to the
         // other marks convention
-        tx.scale(1 / max, -1 / max);
-        tx.translate(-bounds.getCenterX(), -bounds.getCenterY());
+        double fontSize = font.getSize();
+        tx.scale(1 / fontSize, -1 / fontSize);
+        tx.translate(-0.5, 0.5);
         ExplicitBoundsShape shape = new 
ExplicitBoundsShape(tx.createTransformedShape(s));
         shape.setBounds(new Rectangle2D.Double(-0.5,0.5,1.0,1.0));
         return shape;

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to