mirror of
https://github.com/olgamiller/SSTVEncoder2.git
synced 2026-04-05 14:25:41 +00: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
1 changed files with 4 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue