mirror of
https://github.com/olgamiller/SSTVEncoder2.git
synced 2025-12-06 06:52:01 +01:00
Moved the outline inset to getBounds (where float rectangle is used) and enlarged the inset
(Because e.g. "k" in "Droid Sans Mono" has very sharp corners, which were outside the active text shadow)
This commit is contained in:
parent
68701fc5a1
commit
c3917bb40d
|
|
@ -95,6 +95,10 @@ class LabelPainter {
|
|||
public RectF getBounds() {
|
||||
RectF bounds = new RectF(getTextBounds());
|
||||
bounds.offset(mX, mY);
|
||||
if (mLabel.getOutline()) {
|
||||
float inset = mLabel.getOutlineSize() * mPaint.getTextSize();
|
||||
bounds.inset(-inset, -inset);
|
||||
}
|
||||
return bounds;
|
||||
}
|
||||
|
||||
|
|
@ -113,10 +117,6 @@ class LabelPainter {
|
|||
Rect bounds = new Rect();
|
||||
String text = mLabel.getText();
|
||||
mPaint.getTextBounds(text, 0, text.length(), bounds);
|
||||
if (mLabel.getOutline()) {
|
||||
int dxOutline = (int) (mLabel.getOutlineSize() * mPaint.getTextSize()) / 2;
|
||||
bounds.inset(-dxOutline, -dxOutline);
|
||||
}
|
||||
return bounds;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue