fix displaced caption labels

- use 'dy' in label bounding box
This commit is contained in:
Hannes Janetzek 2013-08-04 14:37:45 +02:00
parent 80624a5d06
commit 049751f05f
2 changed files with 8 additions and 2 deletions

View File

@ -516,7 +516,8 @@ public class TextRenderLayer extends BasicRenderLayer {
l.bbox.setNormalized(l.x, l.y, cos, -sin,
l.width + MIN_CAPTION_DIST,
l.text.fontHeight + MIN_CAPTION_DIST);
l.text.fontHeight + MIN_CAPTION_DIST,
l.text.dy);
boolean overlaps = false;

View File

@ -134,13 +134,18 @@ public class OBB2D {
computeAxes();
}
public void setNormalized(float cx, float cy, float vx, float vy, float width, float height) {
public void setNormalized(float cx, float cy, float vx, float vy, float width, float height, float dy) {
float ux = -vy;
float uy = vx;
float hw = width / 2;
float hh = height / 2;
if (dy != 0){
cx += vx * dy + vy * dy;
cy += -vy * dy + vx * dy;
}
vx *= hw;
vy *= hw;