Use the Unicode diameter symbol ⌀ in diameter constraints.

Before this commit, the diameter symbol was drawn using custom code,
which is not necessary anymore.
pull/4/head
whitequark 2016-04-16 01:07:35 +00:00
parent 23dc36da9b
commit bd51a9edac
1 changed files with 1 additions and 27 deletions

View File

@ -61,8 +61,7 @@ std::string Constraint::Label(void) {
result = comment;
} else if(type == DIAMETER) {
if(!other) {
// leading spaces for diameter symbol
result = " " + SS.MmToString(valA);
result = "" + SS.MmToString(valA);
} else {
result = "R" + SS.MmToString(valA / 2);
}
@ -536,31 +535,6 @@ void Constraint::DrawOrGetDistance(Vector *labelPos) {
Vector topLeft;
DoLabel(ref, &topLeft, gr, gu);
if(labelPos) *labelPos = topLeft;
// Show this as diameter or radius?
if(!other) {
// Draw the diameter symbol
Vector dc = topLeft;
dc = dc.Plus(gu.WithMagnitude(5/SS.GW.scale));
dc = dc.Plus(gr.WithMagnitude(9/SS.GW.scale));
double dr = 5/SS.GW.scale;
double theta, dtheta = (2*PI)/12;
for(theta = 0; theta < 2*PI-0.01; theta += dtheta) {
LineDrawOrGetDistance(
dc.Plus(gu.WithMagnitude(cos(theta)*dr)).Plus(
gr.WithMagnitude(sin(theta)*dr)),
dc.Plus(gu.WithMagnitude(cos(theta+dtheta)*dr)).Plus(
gr.WithMagnitude(sin(theta+dtheta)*dr)));
}
theta = 25*(PI/180);
dr *= 1.7;
dtheta = PI;
LineDrawOrGetDistance(
dc.Plus(gu.WithMagnitude(cos(theta)*dr)).Plus(
gr.WithMagnitude(sin(theta)*dr)),
dc.Plus(gu.WithMagnitude(cos(theta+dtheta)*dr)).Plus(
gr.WithMagnitude(sin(theta+dtheta)*dr)));
}
break;
}