Code

Fixed icon loading, cacheing and fallback to use stock mechanisms.
[inkscape.git] / src / display / sodipodi-ctrl.cpp
index 0172cc8bb3899a963c1221e43e478550aff4d320..db199d3a51e2421a0d6a72fe1414689506f2420f 100644 (file)
@@ -512,7 +512,7 @@ sp_ctrl_render (SPCanvasItem *item, SPCanvasBuf *buf)
     bool colormode;
 
     for (y = y0; y <= y1; y++) {
-        p = buf->buf + (y - buf->rect.y0) * buf->buf_rowstride + (x0 - buf->rect.x0) * 3;
+        p = buf->buf + (y - buf->rect.y0) * buf->buf_rowstride + (x0 - buf->rect.x0) * 4;
         q = ctrl->cache + ((y - ctrl->box.y0) * (ctrl->span*2+1) + (x0 - ctrl->box.x0)) * 4;
         for (x = x0; x <= x1; x++) {
             a = *(q + 3);
@@ -527,13 +527,13 @@ sp_ctrl_render (SPCanvasItem *item, SPCanvasBuf *buf)
                 p[1] = COMPOSE_N (p[1], q[1], a);
                 p[2] = COMPOSE_N (p[2], q[2], a);
                 q += 4;
-                p += 3;
+                p += 4;
             } else if (ctrl->mode == SP_CTRL_MODE_XOR) {
                 p[0] = COMPOSE_X (p[0], q[0], a);
                 p[1] = COMPOSE_X (p[1], q[1], a);
                 p[2] = COMPOSE_X (p[2], q[2], a);
                 q += 4;
-                p += 3;
+                p += 4;
             }
         }
     }