Commit f32864a0 authored by Christoffer Ackelman's avatar Christoffer Ackelman

Fixed GlowPolyline not redrawing when attributes change.

parent 14e5b18f
......@@ -2202,6 +2202,7 @@ int GeDyn::scan(grow_tObject object)
|| sts == GLOW__SUBTERMINATED || sts == GLOW__SWAPTERMINATED)
return sts;
}
grow_RedrawDefered(graph->grow->ctx);
return 1;
}
......
......@@ -323,7 +323,7 @@ void GrowWindow::draw(DrawWind* w, GlowTransform* t, int highlight, int hot,
ctx->gdraw->rect(
ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, fill_drawtype, 1, 0);
window_ctx->draw(w, ll_x, ll_y, ur_x, ur_y);
window_ctx->draw(window_ctx->mw, ll_x, ll_y, ur_x, ur_y);
ctx->gdraw->pop_customcolors();
}
......
......@@ -153,9 +153,7 @@ void GlowPolyLine::open(std::ifstream& fp)
void GlowPolyLine::get_borders(double pos_x, double pos_y, double* x_right,
double* x_left, double* y_high, double* y_low, void* node)
{
int i;
for (i = 0; i < a_points.a_size - 1; i++) {
for (int i = 0; i < a_points.a_size - 1; i++) {
if (pos_x + ((GlowPoint*)a_points[i])->x < *x_left)
*x_left = pos_x + ((GlowPoint*)a_points[i])->x;
if (pos_x + ((GlowPoint*)a_points[i + 1])->x < *x_left)
......@@ -178,19 +176,16 @@ void GlowPolyLine::get_borders(double pos_x, double pos_y, double* x_right,
void GlowPolyLine::add_points(
void* pos, glow_sPoint* pointarray, int point_cnt, int highlight, int hot)
{
int i;
if (points) {
// erase( pos, hot, NULL);
// nav_erase( pos, NULL);
free((char*)points);
}
points = (glow_sPointX*)calloc(
a_points.a_size + point_cnt, sizeof(glow_sPointX));
for (i = 0; i < point_cnt; i++) {
for (int i = 0; i < point_cnt; i++) {
GlowPoint* p = new GlowPoint(ctx, pointarray[i].x, pointarray[i].y);
a_points.insert(p);
}
zoom();
nav_zoom();
ctx->set_dirty();
}
......@@ -64,14 +64,17 @@ public:
void set_fill(int fillval)
{
fill = fillval;
ctx->set_dirty();
}
void set_drawtype(glow_eDrawType drawtype)
{
draw_type = drawtype;
ctx->set_dirty();
}
void set_linewidth(int linewidth)
{
line_width = linewidth;
ctx->set_dirty();
}
void add_points(void* pos, glow_sPoint* pointarray, int point_cnt,
int highlight, int hot);
......
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