<html><head></head><body><div class="ydp54bc1f1cyahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div></div>
        <div dir="ltr" data-setdir="false">Hi Uli,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Thanks for your reply.</div><div dir="ltr" data-setdir="false">Using rounding indeed gives a much better picture so it fixes my problem.<br>What I do not fully understand is why miter join would create the overshoot I was seeing.<br><br><div>I had expected that this would not draw before or after the coordinate the line ends (and at least not overshooting two or three pixels)</div><div><br></div><div dir="ltr" data-setdir="false">Kind regards, Frans<br></div></div><div><br></div>
        
        </div><div id="ydpd0318ca5yahoo_quoted_7490765351" class="ydpd0318ca5yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    Op woensdag 9 maart 2022 16:56:10 CET schreef Uli Schlachter <psychon@znc.in>:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div dir="ltr">Hi,<br clear="none"><br clear="none">Am 09.03.22 um 14:34 schrieb Frans Meulenbroeks:<br clear="none">[...]<br clear="none">> However when I look at the resulting image I get things like the image below.<br clear="none">> E.g. I am not very happy with the pixel at 798, 205 as I am drawing no lines with x < 800 at all.As these are measurement results I would like to see less overshoot.As you can see from the code above I already added 0.5 to the coordinates.Is there a way to improve this? Or where is my expectation wrong?<br clear="none"><br clear="none">I tried to turn your code sample into an executable program. The result<br clear="none">is attached (I also guess a line width of 1). Next I also guessed that<br clear="none">this is due to a line join. The default join is miter, which is<br clear="none">documented as:<br clear="none"><br clear="none"> * @CAIRO_LINE_JOIN_MITER: use a sharp (angled) corner, see<br clear="none"> * cairo_set_miter_limit() (Since 1.0)<br clear="none"><br clear="none">I set the line join to round and the result changed. This is already<br clear="none">done in the attached program.<div class="ydpd0318ca5yqt8221339753" id="ydpd0318ca5yqtfd21636"><br clear="none"><br clear="none">> PS: this is all rendered using an ARGB32 surface of 1920x1080 pixels</div><br clear="none"><br clear="none">I went with a 15x15 image. And with RGB24 since my image viewer would<br clear="none">otherwise not tell me where the top left corner of the image is.<br clear="none"><br clear="none">Cheers,<br clear="none">Uli<br clear="none">-- <br clear="none">"In the beginning the Universe was created. This has made a lot of<br clear="none"> people very angry and has been widely regarded as a bad move."</div></div>
            </div>
        </div></body></html>