```9front - general discussion about 9front
help / color / mirror / Atom feed```
```* [9front] [PATCH] plot: fix disc and circle operations
@ 2022-10-22 16:22 an2qzavok
2022-10-22 18:21 ` ori
0 siblings, 2 replies; 5+ messages in thread
From: an2qzavok @ 2022-10-22 16:22 UTC (permalink / raw)
To: 9front

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);

```* Re: [9front] [PATCH] plot: fix disc and circle operations
2022-10-22 16:22 [9front] [PATCH] plot: fix disc and circle operations an2qzavok
@ 2022-10-22 18:21 ` ori
2022-10-22 18:25   ` an2qzavok
From: ori @ 2022-10-22 18:21 UTC (permalink / raw)
To: 9front

gmail's web interfaces replaces tabs with spaces,
so this patch will not apply; can you resend as an
attachment?

Quoth an2qzavok <an2qzavok@gmail.com>:
> 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);

```* Re: [9front] [PATCH] plot: fix disc and circle operations
2022-10-22 18:21 ` ori
@ 2022-10-22 18:25   ` an2qzavok
2022-10-22 18:31     ` ori
From: an2qzavok @ 2022-10-22 18:25 UTC (permalink / raw)
To: 9front

[-- Attachment #1: Type: text/plain, Size: 2605 bytes --]

sorry, here

сб, 22 окт. 2022 г. в 21:23, <ori@eigenstate.org>:
>
> gmail's web interfaces replaces tabs with spaces,
> so this patch will not apply; can you resend as an
> attachment?
>
> Quoth an2qzavok <an2qzavok@gmail.com>:
> > 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
> > +    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 @@
> >      else
> > +    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)
> > +{
> > +    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);
>

[-- Attachment #2.1: Type: text/plain, Size: 377 bytes --]

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.

Content-Type: text/x-patch; charset="US-ASCII"; name="plot.diff"
Content-Disposition: attachment; filename="plot.diff"
Content-Transfer-Encoding: base64
Content-ID: <f_l9k93d3r0>

[-- Attachment #2.2: plot.diff.suspect --]
[-- Type: application/octet-stream, Size: 1745 bytes --]

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);

```* Re: [9front] [PATCH] plot: fix disc and circle operations
2022-10-22 18:25   ` an2qzavok
@ 2022-10-22 18:31     ` ori
0 siblings, 0 replies; 5+ messages in thread
From: ori @ 2022-10-22 18:31 UTC (permalink / raw)
To: 9front

done, thanks

```* Re: [9front] [PATCH] plot: fix disc and circle operations
2022-10-22 16:22 [9front] [PATCH] plot: fix disc and circle operations an2qzavok
2022-10-22 18:21 ` ori
@ 2022-10-22 18:53 ` Thaddeus Woskowiak
1 sibling, 0 replies; 5+ messages in thread
To: 9front

On Sat, Oct 22, 2022 at 12:24 PM an2qzavok <an2qzavok@gmail.com> 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 @@
>      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);

in cat-v the other day. Time to sysupdate.

```end of thread, other threads:[~2022-10-22 18:54 UTC | newest]

```This is a public inbox, see mirroring instructions