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 457 invoked from network); 22 Oct 2022 18:27:21 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 22 Oct 2022 18:27:21 -0000 Received: from mail-ed1-f50.google.com ([209.85.208.50]) by 9front; Sat Oct 22 14:26:02 -0400 2022 Received: by mail-ed1-f50.google.com with SMTP id b12so17251086edd.6 for <9front@9front.org>; Sat, 22 Oct 2022 11:25:57 -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=u6hoXZTRd/yCc0pLq7skqwFZ24wCPlGRAZqJoRjCAJA=; b=jbp/7VADLW2ZKfjqqVovNeia2GPzspAZKKk+urAWxZRTSqNcJAwIclmngPLbWfBAc0 G2KQX56LgvK/6ptOsykcfdZm+B83t0CZKea1zFvNiMPDAdd7d4QG2qyOfmi9/hBTSSWC NWHSonPGWePHZAuuabjwphLW5W8d/2PVgKilGUZZpK3iQz7AItq4cqyCp/PLEinG1mED QrDe1DlPMPCdU+DF/aSC4ovzPGiC3oiH0CqnqB6YaaOKbk1jw2YVOtFyFQ72KBfj06er huRE1GNpZryj/TA5rzohA5WvnU3OAXKmy+O0ckH4LYKvnXqeQuaXfa5YY53hjsZH1o1k 6lJw== 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=u6hoXZTRd/yCc0pLq7skqwFZ24wCPlGRAZqJoRjCAJA=; b=eejE4aSfDF+w8+6rfayaPnLzKT+k2Vz2JA0P5+r1z2amBfhPe+fT7wTeOMaI5grb7/ xpuCcy4xmtYiho2L96reoxWFdI2IaclzwA7muLlhrwFqYC2h8C6ZA26PUkJH9r3EzA0p ElQCcNxW1FUQkeBH5kkT7WhqSzczrynSqOPVq68hRBXC7hXR7pyKfCubjp5Y2bBubyeK xHOdVjcEQd+7ikwB9/rqqJsiOg5bcKUoTz0Va+j1gKdtVCdWme2scQzrx1LTgybMQbb/ bWxFwBum4re6XGrz9GXkkwlfvQqfUO4h2+gIfwg12fhE1PY2XmtrwE8zULChTcjGtYdv Z72w== X-Gm-Message-State: ACrzQf1V6cyd1LtOK/3+5jq53EyhE+NkFeUOkbmjYN61lmrq2Brzh1xJ UHYshFRTamRA25N1DIbeSHJJ+Crtmjyrg4tNPooXA2rx X-Google-Smtp-Source: AMsMyM4YImvXqTuvHVnGM1BsUbS80p095Xr2cW+aGaWQsgQ0nr2pplbryKEBV89Z7rGSmBU/taDE6afy/OFCdlEO4RY= X-Received: by 2002:a05:6402:5419:b0:457:c955:a40f with SMTP id ev25-20020a056402541900b00457c955a40fmr22509384edb.391.1666463156303; Sat, 22 Oct 2022 11:25:56 -0700 (PDT) MIME-Version: 1.0 References: <3A50E8E5B8D51491A6E410FCE21A491F@eigenstate.org> In-Reply-To: <3A50E8E5B8D51491A6E410FCE21A491F@eigenstate.org> From: an2qzavok Date: Sat, 22 Oct 2022 21:25:43 +0300 Message-ID: To: 9front@9front.org Content-Type: multipart/mixed; boundary="00000000000076976d05eba3b0f8" List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: self-healing compliant realtime-java reduce/map database Subject: Re: [9front] [PATCH] plot: fix disc and circle operations Reply-To: 9front@9front.org Precedence: bulk --00000000000076976d05eba3b0f8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable sorry, here =D1=81=D0=B1, 22 =D0=BE=D0=BA=D1=82. 2022 =D0=B3. =D0=B2 21:23, : > > gmail's web interfaces replaces tabs with spaces, > so this patch will not apply; can you resend as an > attachment? > > Quoth an2qzavok : > > 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=3DSCR(-r); > > else > > rad=3DSCR(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=3DSCR(-r); > > else > > rad=3DSCR(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 !=3D 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 !=3D 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 !=3D 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); > --00000000000076976d05eba3b0f8 X-Attachment-Id: f_l9k93d3r0 Content-Type: multipart/mixed; boundary="upas-iloxsadkyjhdcbosnjsighkfzk" Content-Disposition: inline This is a multi-part message in MIME format. --upas-iloxsadkyjhdcbosnjsighkfzk Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit from postmaster@9front: The following attachment had content that we can't prove to be harmless. To avoid possible automatic execution, we changed the content headers. The original header was: Content-Type: text/x-patch; charset="US-ASCII"; name="plot.diff" Content-Disposition: attachment; filename="plot.diff" Content-Transfer-Encoding: base64 Content-ID: --upas-iloxsadkyjhdcbosnjsighkfzk Content-Type: application/octet-stream Content-Disposition: attachment; filename="plot.diff.suspect" Content-Transfer-Encoding: base64 ZGlmZiBkZmVlMDhkNTBkZjY3NGNkNzZmNzQzMjBiYzljOGJjNmE0YTk1ZjFlIHVuY29tbWl0dGVk Ci0tLSBhL3N5cy9zcmMvY21kL3Bsb3QvbGlicGxvdC9jaXJjLmMKKysrIGIvc3lzL3NyYy9jbWQv cGxvdC9saWJwbG90L2NpcmMuYwpAQCAtOCw1ICs4LDUgQEAKIAkJcmFkPVNDUigtcik7CiAJZWxz ZQogCQlyYWQ9U0NSKHIpOwotCWVsbGlwc2Uoc2NyZWVuLCBwLCByYWQsIHJhZCwgMCwgZ2V0Y29s b3IoZTEtPmZvcmVnciksIFpQKTsKKwltX2NpcmMocCwgcmFkLCBlMS0+Zm9yZWdyKTsKIH0KLS0t IGEvc3lzL3NyYy9jbWQvcGxvdC9saWJwbG90L2Rpc2suYworKysgYi9zeXMvc3JjL2NtZC9wbG90 L2xpYnBsb3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gWlApOworCWlmIChvZmZzY3JlZW4gIT0gc2NyZWVuICYmICFidWZmZXIpCisJCWZpbGxl bGxpcHNlKHNjcmVlbiwgcCwgcmFkLCByYWQsIGdldGNvbG9yKGMpLCBaUCk7Cit9CisKIC8qCiAg KiBEcmF3IHRleHQgYmV0d2VlbiBwb2ludGVycyBwIGFuZCBxIHdpdGggZmlyc3QgY2hhcmFjdGVy IGNlbnRlcmVkIGF0IHgsIHkuCiAgKiBVc2UgY29sb3IgYy4gIENlbnRlcmVkIGlmIGNlbiBpcyBu b24temVybywgcmlnaHQtanVzdGlmaWVkIGlmIHJpZ2h0IGlzIG5vbi16ZXJvLgotLS0gYS9zeXMv c3JjL2NtZC9wbG90L2xpYnBsb3QvbXBsb3QuaAorKysgYi9zeXMvc3JjL2NtZC9wbG90L2xpYnBs b3QvbXBsb3QuaApAQCAtMzYsNiArMzYsOCBAQAogICovCiAjaW5jbHVkZSAiLi4vcGxvdC5oIgog dm9pZCBtX2NscndpbihpbnQsIGludCwgaW50LCBpbnQsIGludCk7Cit2b2lkIG1fY2lyYyhQb2lu dCwgaW50LCBpbnQpOwordm9pZCBtX2Rpc2MoUG9pbnQsIGludCwgaW50KTsKIHZvaWQgbV9maW5p c2godm9pZCk7CiB2b2lkIG1faW5pdGlhbGl6ZShjaGFyICopOwogaW50IG1fdGV4dChpbnQsIGlu dCwgY2hhciAqLCBjaGFyICosIGludCwgaW50LCBpbnQpOwo= --upas-iloxsadkyjhdcbosnjsighkfzk-- --00000000000076976d05eba3b0f8--