Commit 1ae8ae08 authored by Claes Sjofors's avatar Claes Sjofors

Ge draw optimization for lines and arcs

parent 6e14fa93
...@@ -1340,6 +1340,13 @@ int GlowDrawGtk::arc( GlowWind *wind, int x, int y, int width, int height, ...@@ -1340,6 +1340,13 @@ int GlowDrawGtk::arc( GlowWind *wind, int x, int y, int width, int height,
if ( ctx->nodraw) return 1; if ( ctx->nodraw) return 1;
DrawWindGtk *w = (DrawWindGtk *) wind->window; DrawWindGtk *w = (DrawWindGtk *) wind->window;
if ( w->clip_on &&
!(w->clip_rectangle[w->clip_cnt-1].x <= x + width &&
w->clip_rectangle[w->clip_cnt-1].x + w->clip_rectangle[w->clip_cnt-1].width >= x &&
w->clip_rectangle[w->clip_cnt-1].y <= y + height &&
w->clip_rectangle[w->clip_cnt-1].y + w->clip_rectangle[w->clip_cnt-1].height >= y))
return 1;
if ( gc_type == glow_eDrawType_LineGray && highlight) if ( gc_type == glow_eDrawType_LineGray && highlight)
gc_type = glow_eDrawType_Line; gc_type = glow_eDrawType_Line;
...@@ -1442,6 +1449,13 @@ int GlowDrawGtk::line( GlowWind *wind, int x1, int y1, int x2, int y2, ...@@ -1442,6 +1449,13 @@ int GlowDrawGtk::line( GlowWind *wind, int x1, int y1, int x2, int y2,
if ( ctx->nodraw) return 1; if ( ctx->nodraw) return 1;
DrawWindGtk *w = (DrawWindGtk *) wind->window; DrawWindGtk *w = (DrawWindGtk *) wind->window;
if ( w->clip_on &&
!(w->clip_rectangle[w->clip_cnt-1].x <= x2 &&
w->clip_rectangle[w->clip_cnt-1].x + w->clip_rectangle[w->clip_cnt-1].width >= x1 &&
w->clip_rectangle[w->clip_cnt-1].y <= y2 &&
w->clip_rectangle[w->clip_cnt-1].y + w->clip_rectangle[w->clip_cnt-1].height >= y1))
return 1;
// Fix for highlight for connections in grow // Fix for highlight for connections in grow
if ( highlight && ctx->type() == glow_eCtxType_Grow) if ( highlight && ctx->type() == glow_eCtxType_Grow)
gc_type = glow_eDrawType_LineHighlight; gc_type = glow_eDrawType_LineHighlight;
......
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