Commit fcf8e390 authored by Christoffer Ackelman's avatar Christoffer Ackelman

Fixed drawing of multiline GrowAnnot.

parent a5d77782
...@@ -236,7 +236,7 @@ void GrowAnnot::draw(GlowWind* w, GlowTransform* t, int highlight, int hot, ...@@ -236,7 +236,7 @@ void GrowAnnot::draw(GlowWind* w, GlowTransform* t, int highlight, int hot,
glow_eDrawType color = ctx->get_drawtype(color_drawtype, glow_eDrawType color = ctx->get_drawtype(color_drawtype,
glow_eDrawType_LineHighlight, highlight, (GrowNode*)colornode, 2); glow_eDrawType_LineHighlight, highlight, (GrowNode*)colornode, 2);
ctx->gdraw->get_text_extent("", 0, ldraw_type, idx, lfont, &z_width, ctx->gdraw->get_text_extent("Ag", 0, ldraw_type, idx, lfont, &z_width,
&z_height, &z_descent, tsize, 0); &z_height, &z_descent, tsize, 0);
for (s = ((GlowNode*)node)->annotv[number]; *s; s++) { for (s = ((GlowNode*)node)->annotv[number]; *s; s++) {
if (*s == 10) { if (*s == 10) {
...@@ -252,9 +252,10 @@ void GrowAnnot::draw(GlowWind* w, GlowTransform* t, int highlight, int hot, ...@@ -252,9 +252,10 @@ void GrowAnnot::draw(GlowWind* w, GlowTransform* t, int highlight, int hot,
} else } else
len++; len++;
} }
if (len) if (len) {
ctx->gdraw->text((int)p.x, (int)p.y + line_cnt * z_height, line, len, ctx->gdraw->text((int)p.x, (int)p.y + line_cnt * z_height, line, len,
ldraw_type, color, idx, highlight, lfont, tsize, 0); ldraw_type, color, idx, highlight, lfont, tsize, 0);
}
break; break;
} }
} }
...@@ -384,7 +385,7 @@ void GrowAnnot::erase(GlowWind* w, GlowTransform* t, int hot, void* node) ...@@ -384,7 +385,7 @@ void GrowAnnot::erase(GlowWind* w, GlowTransform* t, int hot, void* node)
int line_cnt = 0; int line_cnt = 0;
char* line = ((GlowNode*)node)->annotv[number]; char* line = ((GlowNode*)node)->annotv[number];
char* s; char* s;
ctx->gdraw->get_text_extent("", 0, ldraw_type, idx, lfont, &z_width, ctx->gdraw->get_text_extent("Ag", 0, ldraw_type, idx, lfont, &z_width,
&z_height, &z_descent, tsize, 0); &z_height, &z_descent, tsize, 0);
for (s = ((GlowNode*)node)->annotv[number]; *s; s++) { for (s = ((GlowNode*)node)->annotv[number]; *s; s++) {
if (*s == 10) { if (*s == 10) {
...@@ -401,10 +402,11 @@ void GrowAnnot::erase(GlowWind* w, GlowTransform* t, int hot, void* node) ...@@ -401,10 +402,11 @@ void GrowAnnot::erase(GlowWind* w, GlowTransform* t, int hot, void* node)
} else } else
len++; len++;
} }
if (len) if (len) {
ctx->gdraw->text((int)p.x, (int)p.y + line_cnt * z_height, line, len, ctx->gdraw->text((int)p.x, (int)p.y + line_cnt * z_height, line, len,
get_erase_gc(ldraw_type), glow_eDrawType_Line, idx, 0, lfont, get_erase_gc(ldraw_type), glow_eDrawType_Line, idx, 0, lfont,
tsize, 0); tsize, 0);
}
break; break;
} }
} }
...@@ -477,7 +479,7 @@ void GrowAnnot::erase_background( ...@@ -477,7 +479,7 @@ void GrowAnnot::erase_background(
int line_cnt = 0; int line_cnt = 0;
char* line = ((GlowNode*)node)->annotv[number]; char* line = ((GlowNode*)node)->annotv[number];
char* s; char* s;
ctx->gdraw->get_text_extent("", 0, ldraw_type, idx, lfont, &z_width, ctx->gdraw->get_text_extent("Ag", 0, ldraw_type, idx, lfont, &z_width,
&z_height, &z_descent, tsize, 0); &z_height, &z_descent, tsize, 0);
for (s = ((GlowNode*)node)->annotv[number]; *s; s++) { for (s = ((GlowNode*)node)->annotv[number]; *s; s++) {
if (*s == 10) { if (*s == 10) {
...@@ -494,10 +496,11 @@ void GrowAnnot::erase_background( ...@@ -494,10 +496,11 @@ void GrowAnnot::erase_background(
} else } else
len++; len++;
} }
if (len) if (len) {
ctx->gdraw->text((int)p.x, (int)p.y + line_cnt * z_height, line, len, ctx->gdraw->text((int)p.x, (int)p.y + line_cnt * z_height, line, len,
get_erase_gc(ldraw_type), glow_eDrawType_Line, idx, 0, lfont, get_erase_gc(ldraw_type), glow_eDrawType_Line, idx, 0, lfont,
tsize, 0); tsize, 0);
}
break; break;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment