From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 3928 invoked from network); 22 Oct 2022 18:54:19 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 22 Oct 2022 18:54:19 -0000 Received: from mail-pj1-f51.google.com ([209.85.216.51]) by 9front; Sat Oct 22 14:52:55 -0400 2022 Received: by mail-pj1-f51.google.com with SMTP id f9-20020a17090a654900b00210928389f8so9579387pjs.2 for <9front@9front.org>; Sat, 22 Oct 2022 11:52:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=W4+CmVfYbgmYB/b+7mEg6cxbGLKy5Cuqa4f9FbG/mEA=; b=pvlIxxaUuP0jG9E9ujgz6DONvPS2V2g+hv93bzv0JG5jaFoMCvU1zNAFoBoJrXGh1D Mga1vEzgAAYuc0+oZy12zdBn8ZEqmoEFIg+H7loTTY+SNjfEeZ/BUsMcTOMapFs3N7Wu xYHfK6J1JBxVwQck0GD6R88gyHKO5mksEdahwC1fJ0CyesQeyGy3aehlsf6WznN2DDWI azywPadDszrPG+pq02fVXLrILoa+q5VqLH1TfXDAbK1eB+t8ZtPBPH/mYlmOBg3b6rye AYNF9MjHtR8EVx7R5WcbTyAx8WbaukyzdKJb/aordwAdasfu8/bQa/CJehntr7Yx/Sx9 K/1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=W4+CmVfYbgmYB/b+7mEg6cxbGLKy5Cuqa4f9FbG/mEA=; b=DjwJQJOWqXRqPLAQjmN2h03X/BzCHF9GGHLzhoZgThHWl6iVFkW8Xvfe7UCAgO/h3M VV1FfbO1jLXqBQ0EwPkcxHQUEV5G8ukHvlHa2FV002MKZ1CQfVzTZj7Yfy1BOqUxqyh/ cG/6xwEwoylqy8HxOJFTpE0743sbEN5NBPE69fI4XV7ORKhV2keZqNNLP+OEna6ZgKIL uvS6o7rIEII88zyiPfpjmHVOyLe5Zf/pkVx70dV5u2219OGZwRhk3MVqJxv7feM3kiR7 NtnQm9TzU2MGHYzznA+qEokmNI6KhV8tFFNqBHGjJBUztPTJmw0zes6uZoCzan1IZXXR KZdw== X-Gm-Message-State: ACrzQf0X9UwbF+7BpmuYEykSB31b9l13G8ogRAf/k33UvSOzpUu9mnUk JkQnyoun+lbbL+yj82H7xf/kaxHvx3u8AkSsLzcFez5r X-Google-Smtp-Source: AMsMyM5emCWMXo805pUk3a2AVuMGx3MXJwVWPT8QZiuBglaBrte40nW4sttIUeE0LMrzj1xYCr8C3lXZzzB3t2+LAr8= X-Received: by 2002:a17:902:eb8c:b0:186:7fb5:2143 with SMTP id q12-20020a170902eb8c00b001867fb52143mr7971066plg.30.1666464770252; Sat, 22 Oct 2022 11:52:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Thaddeus Woskowiak Date: Sat, 22 Oct 2022 14:53:52 -0400 Message-ID: To: 9front@9front.org Content-Type: text/plain; charset="UTF-8" List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: ISO-certified service NoSQL realtime-based blockchain Subject: Re: [9front] [PATCH] plot: fix disc and circle operations Reply-To: 9front@9front.org Precedence: bulk On Sat, Oct 22, 2022 at 12:24 PM an2qzavok wrote: > > Discs and circles were drawn on screen directly and later erased by > offscreen buffer. > This change puts them in line with other operations, which draw to > offscreen first and to screen when necessary > > diff dfee08d50df674cd76f74320bc9c8bc6a4a95f1e uncommitted > --- a/sys/src/cmd/plot/libplot/circ.c > +++ b/sys/src/cmd/plot/libplot/circ.c > @@ -8,5 +8,5 @@ > rad=SCR(-r); > else > rad=SCR(r); > - ellipse(screen, p, rad, rad, 0, getcolor(e1->foregr), ZP); > + m_circ(p, rad, e1->foregr); > } > --- a/sys/src/cmd/plot/libplot/disk.c > +++ b/sys/src/cmd/plot/libplot/disk.c > @@ -8,5 +8,5 @@ > rad=SCR(-r); > else > rad=SCR(r); > - fillellipse(screen, p, rad, rad, getcolor(e1->foregr), ZP); > + m_disc(p, rad, e1->foregr); > } > --- a/sys/src/cmd/plot/libplot/machdep.c > +++ b/sys/src/cmd/plot/libplot/machdep.c > @@ -34,6 +34,29 @@ > if(offscreen != screen && !buffer) > draw(screen, xlr(Rect(x0, y0, x1+1, y1+1)), getcolor(c), nil, ZP); > } > + > +/* > + * Draw circle at point p with radius rad in color c > + */ > +void > +m_circ(Point p, int rad, int c) > +{ > + ellipse(offscreen, p, rad, rad, 0, getcolor(c), ZP); > + if (offscreen != screen && !buffer) > + ellipse(screen, p, rad, rad, 0, getcolor(c), ZP); > +} > + > +/* > + * Draw disc (filled circle) at point p with radius rad in color c > + */ > +void > +m_disc(Point p, int rad, int c) > +{ > + fillellipse(offscreen, p, rad, rad, getcolor(c), ZP); > + if (offscreen != screen && !buffer) > + fillellipse(screen, p, rad, rad, getcolor(c), ZP); > +} > + > /* > * Draw text between pointers p and q with first character centered at x, y. > * Use color c. Centered if cen is non-zero, right-justified if > right is non-zero. > --- a/sys/src/cmd/plot/libplot/mplot.h > +++ b/sys/src/cmd/plot/libplot/mplot.h > @@ -36,6 +36,8 @@ > */ > #include "../plot.h" > void m_clrwin(int, int, int, int, int); > +void m_circ(Point, int, int); > +void m_disc(Point, int, int); > void m_finish(void); > void m_initialize(char *); > int m_text(int, int, char *, char *, int, int, int); Thank you for fixing these bugs. I was the one asking about this issue in cat-v the other day. Time to sysupdate.