```9front - general discussion about 9front
help / color / mirror / Atom feed```
```From: an2qzavok <an2qzavok@gmail.com>
To: 9front@9front.org
Subject: [9front] [PATCH] plot: fix disc and circle operations
Date: Sat, 22 Oct 2022 19:22:59 +0300	[thread overview]
Message-ID: <CAB-jnzgp2FOk2rch6MqPccG3cDqUO6=e_wbwP=En0GpSYuZB7g@mail.gmail.com> (raw)

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 @@
else
}
--- a/sys/src/cmd/plot/libplot/disk.c
+++ b/sys/src/cmd/plot/libplot/disk.c
@@ -8,5 +8,5 @@
else
}
--- 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)
+{
+    if (offscreen != screen && !buffer)
+}
+
+/*
+ * Draw disc (filled circle) at point p with radius rad in color c
+ */
+void
+m_disc(Point p, int rad, int c)
+{
+    if (offscreen != screen && !buffer)
+}
+
/*
* 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);
```

```next             reply	other threads:[~2022-10-22 16:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-22 16:22 an2qzavok [this message]
2022-10-22 18:21 ` ori
2022-10-22 18:25   ` an2qzavok
2022-10-22 18:31     ` ori
```

```Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,

Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

switches of git-send-email(1):

git send-email \
```This is a public inbox, see mirroring instructions