Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: render
-
Labels:None
Description
GeoTools only take into account the height of my dynamic mark and uses this value to scale my dynamic mark to the wished size (MarkStyle2D.java line 82). If I build a mark, lets say an horizontal arrow, where the basic shape size is rectangular, e.g. length 1 and height 0.1, I got an arrow scaled by 10 but it shouldn't be scaled. That is because shapeSize=0.1 and size=1, therefore scale=10 in getTransformedShape.
It would be helpful to change the basic behaviour to max(height, length). That would deliver a better result. Or is there any reason for the implementation. I am not able to change my marks to a quadratic shape, because I could not use it for fill patterns (distance in height would be to large) and to get the right size, I would have to change my geobasis data.
public Shape getTransformedShape(float x, float y, float rotation) {
if (shape != null) {
Rectangle2D bounds = shape.getBounds2D();
>>>>>>>> double shapeSize = Math.max(bounds.getWidth(), bounds.getHeight());
double scale = size / shapeSize;
TransformedShape ts = new TransformedShape();
thanks
Tobias
Thanks
Tobias