Merge "Issue #1638 Fixed text box drawn to be correct size with padding around text" into development

Former-commit-id: e12bf41edb19fb38673057ea5a1633953e5ebdf3
This commit is contained in:
Nate Jensen 2013-05-28 15:43:23 -05:00 committed by Gerrit Code Review
commit e846e539fb
2 changed files with 7 additions and 5 deletions

View file

@ -125,6 +125,8 @@ import com.sun.opengl.util.j2d.TextRenderer;
* interpolation by default.
* Apr 18, 2013 1638 mschenke Made string rendering always occur in canvas space so
* strings are always readable despite extent
* May 28, 2013 1638 mschenke Made sure {@link TextStyle#BLANKED} text is drawing correct size
* box around text
*
* </pre>
*
@ -1916,9 +1918,9 @@ public class GLTarget extends AbstractGraphicsTarget implements IGLTarget {
double diff = height + textBounds.getY();
double x1 = xy[0] - scaleX;
double y1 = xy[1] - scaleY - diff;
double x2 = xy[0] + width;
double y2 = xy[1] + height - diff;
double y1 = (xy[1] - diff) - scaleY;
double x2 = xy[0] + width + scaleX;
double y2 = (xy[1] - diff) + height + scaleY;
gl.glRectd(x1, y2, x2, y1);

View file

@ -154,7 +154,7 @@ public class TopoResource extends
params.setColorMapMax(5000);
params.setDataMin(Short.MIN_VALUE);
params.setDataMax(Short.MAX_VALUE);
params.setFormatString("0.00");
params.setFormatString("0");
if (styleRule != null) {
// TODO: This basic logic should be extracted somewhere,
@ -324,7 +324,7 @@ public class TopoResource extends
ColorMapCapability.class).getColorMapParameters();
UnitConverter cvt = parameters.getDataToDisplayConverter();
DecimalFormat df = new DecimalFormat(parameters.getFormatString());
DecimalFormat df = new DecimalFormat("0.00");
return String.format(
"%s %s ",
df.format(cvt.convert(height)),