Adjust angle label margin similarly to eda294ef.

pull/424/head
whitequark 2019-05-21 23:05:05 +00:00
parent 9500487a3f
commit 25b6eba148
5 changed files with 3 additions and 3 deletions

View File

@ -349,8 +349,8 @@ void Constraint::DoArcForAngle(Canvas *canvas, Canvas::hStroke hcs,
double r = max(sqrt(rda*rda + rdna*rdna), 15.0 * pixels);
double th = Style::TextHeight(GetStyle()) / camera.scale;
double swidth = VectorFont::Builtin()->GetWidth(th, Label()) + 4*pixels,
sheight = VectorFont::Builtin()->GetCapHeight(th) + 8*pixels;
double swidth = VectorFont::Builtin()->GetWidth(th, Label()) + 8*pixels,
sheight = VectorFont::Builtin()->GetCapHeight(th) + 6*pixels;
double textR = sqrt(swidth * swidth + sheight * sheight) / 2.0;
*ref = pi.Plus(rm.WithMagnitude(std::max(rm.Magnitude(), 15 * pixels + textR)));
@ -412,7 +412,7 @@ void Constraint::DoArcForAngle(Canvas *canvas, Canvas::hStroke hcs,
if(i > 0) {
if(trim) {
DoLineTrimmedAgainstBox(canvas, hcs, *ref, prev, p,
/*extend=*/false, gr, gu, swidth, sheight);
/*extend=*/false, gr, gu, swidth, sheight + 2*pixels);
} else {
DoLine(canvas, hcs, prev, p);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB