Correctly draw vector text for constraints free in 3d.
@ -437,7 +437,7 @@ void Constraint::DoArcForAngle(Canvas *canvas, Canvas::hStroke hcs,
|
|||||||
Vector trans =
|
Vector trans =
|
||||||
(*ref).Plus(gu.ScaledBy(-1.5*VectorFont::Builtin()->GetCapHeight(textHeight)));
|
(*ref).Plus(gu.ScaledBy(-1.5*VectorFont::Builtin()->GetCapHeight(textHeight)));
|
||||||
canvas->DrawVectorText("angle between skew lines", textHeight,
|
canvas->DrawVectorText("angle between skew lines", textHeight,
|
||||||
trans, gr.WithMagnitude(pixels), gu.WithMagnitude(pixels),
|
trans, gr.WithMagnitude(1), gu.WithMagnitude(1),
|
||||||
hcs);
|
hcs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -925,7 +925,8 @@ void Constraint::DoLayout(DrawAs how, Canvas *canvas,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Vector ex = VectorFont::Builtin()->GetExtents(textHeight, "T");
|
Vector ex = VectorFont::Builtin()->GetExtents(textHeight, "T");
|
||||||
canvas->DrawVectorText("T", textHeight, textAt.Minus(ex.ScaledBy(0.5)), u, v, hcs);
|
canvas->DrawVectorText("T", textHeight, textAt.Minus(ex.ScaledBy(0.5)),
|
||||||
|
u.WithMagnitude(1), v.WithMagnitude(1), hcs);
|
||||||
if(refs) refs->push_back(textAt);
|
if(refs) refs->push_back(textAt);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1122,7 +1123,8 @@ s:
|
|||||||
}
|
}
|
||||||
Vector o = m.Plus(offset).Plus(u.WithMagnitude(textHeight/5)),
|
Vector o = m.Plus(offset).Plus(u.WithMagnitude(textHeight/5)),
|
||||||
ex = VectorFont::Builtin()->GetExtents(textHeight, s);
|
ex = VectorFont::Builtin()->GetExtents(textHeight, s);
|
||||||
canvas->DrawVectorText(s, textHeight, o.Minus(ex.ScaledBy(0.5)), r, u, hcs);
|
canvas->DrawVectorText(s, textHeight, o.Minus(ex.ScaledBy(0.5)),
|
||||||
|
r.WithMagnitude(1), u.WithMagnitude(1), hcs);
|
||||||
if(refs) refs->push_back(o);
|
if(refs) refs->push_back(o);
|
||||||
} else {
|
} else {
|
||||||
Vector a = SK.GetEntity(ptA)->PointGetNum();
|
Vector a = SK.GetEntity(ptA)->PointGetNum();
|
||||||
|
BIN
test/constraint/angle/skew.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
test/constraint/angle/skew.slvs
Normal file
@ -47,3 +47,8 @@ TEST_CASE(reference_free_in_3d_migrate_from_v20) {
|
|||||||
CHECK_RENDER("reference_free_in_3d.png");
|
CHECK_RENDER("reference_free_in_3d.png");
|
||||||
CHECK_SAVE("reference_free_in_3d.slvs");
|
CHECK_SAVE("reference_free_in_3d.slvs");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE(skew_render) {
|
||||||
|
CHECK_LOAD("skew.slvs");
|
||||||
|
CHECK_RENDER("skew.png");
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |