<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Aug 8, 2007, at 9:50, Tamas K Papp wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Hi,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I am drawing plots of contiguous rectangles (a grid of rectangles,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">each with different color, to represent a 2d function).<SPAN class="Apple-converted-space"> </SPAN>The</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">boundaries of the rectangles are not integers.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">When using a bitmap surface w/ white background, white lines appear</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">between the rectangles -- I guess this is an artifact of antialiasing.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Adding 0.5 on the sides gets rid of this, but then on the edge of the</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">rectangles, artifacts appear from drawing twice (see left side of</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">attached image).</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">How could I get rid of both?<SPAN class="Apple-converted-space"> </SPAN>Snapping to integer grids is something I</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">want to avoid: I am drawing on vector and bitmap surfaces, and I would</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">have to keep tack of which is which.<SPAN class="Apple-converted-space"> </SPAN>But if there is not other</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">solution, I can try to manage that, I just need to know.</DIV> </BLOCKQUOTE><BR></DIV><DIV>I'm going to assume looking at that little graphic, that you're drawing a "temperature" scale, and doing so with different color blocks. The problem you site is a general one, and it's nice to see the responses, but I'm wondering for at least that particular part, if you can't sidestep the whole thing nicely by just using a linear gradient?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>pseudo coding here...</DIV><DIV>gradient = LinearGradient from(0,0) to (0,1)</DIV><DIV>for (i = 0; i <= 1; i+=0.01)</DIV><DIV>{</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>gradient addColorStop(i, (Color hue(1 - (i * 0.333)))</DIV><DIV>}</DIV><DIV>gradient scale (0, viewHeight)</DIV><DIV>cr source(gradient)</DIV><DIV>cr path(yourRectangle)</DIV><DIV>cr fill</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>You may be able to get away with an increment of just 0.1, you have to play to see how resolute you need it. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>--</DIV><DIV>Travis Griggs</DIV><DIV>Objologist</DIV><DIV>"I choose. Therefore, I Am"</DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>