paint¶
mouse-driven vector paint on the graphics card
NAME
paint - mouse-driven vector paint on the graphics card
SYNOPSIS
paint [-d | -w]
DESCRIPTION
A little vector editor: pick a primitive and a colour from the
on-screen palette, rubber-band shapes onto the canvas, drop fills
into closed outlines, and erase mistakes one shape at a time. The
drawing is a DISPLAY LIST -- shapes, not pixels -- which is what
makes erase possible: the last shape is popped and the canvas
replays. It is driven by the MOUSE: move the crosshair, click a
swatch or tool in the palette strip, press-drag-release to draw, and
click the red X to quit. The keyboard keeps only editing shortcuts.
With -d (how desk launches it), quitting chains back to desk via
SYS_EXEC instead of exiting to the shell. With -w (how wdesk, the
resident-kernel desktop, launches it) quitting re-execs "wdesk -r",
resuming that desktop with its windows intact. With neither flag,
quitting returns to the shell.
MOUSE
The mouse arrives as xterm SGR reports on the console (from a
terminal with mouse reporting, from the emulator's -W browser
mouse-pad, or from a real PS/2 mouse). The crosshair follows the
pointer everywhere -- including up over the palette strip, so you
can see what you are about to click. Then:
move the crosshair follows the pointer
press-drag-release draw the current tool (Line/Box/Circle); for
Fill, a press drops at the pointer
click a swatch select that colour
click a tool cell select Line / Box / Circle / Fill
click the red X quit (the close-box at the right of the strip)
right-click cancel a rubber-band in progress
Line and box rubber-band from the press point to the release. Circle
presses at the CENTRE; the radius is the larger of the drag's x/y
distance. Position lands at terminal-CELL resolution, mapped through
the size the terminal reports (80x24 assumed if it stays silent).
The current tool and colour are bracketed in the palette strip and
echoed on the console.
KEYS (editing shortcuts; movement and selection are the mouse's job)
SPACE anchor the shape, then (second press) commit it;
for Fill: drop at the crosshair
x cancel a rubber-band in progress
e (or u) erase the LAST shape and replay the rest
n new drawing (clear the canvas)
q quit
FILL
The drop must land on background inside a CLOSED outline. paint
probes rightward from the drop point to find the enclosing
outline's colour, then issues the PGC's AREABC: the selected
colour flood-fills, bounded by pixels of the outline's colour. A
drop on a coloured pixel, or in a region open to the right, is
refused. A fill is a shape like any other: erase removes it, and
a replayed fill re-probes nothing -- its boundary colour was
recorded at drop time.
NOTES
The palette strip is protected by the card itself: the drawing
session runs with WINDOW/VWPORT set to the canvas, so every
stroke, ghost and fill clips at the canvas edge. The crosshair
and rubber-bands draw in LINFUN complement mode -- drawing one
twice restores the screen exactly, over any colours -- and solid
commits return to replace mode. Circles cap at radius 255 (the
PGC ELIPSE rule); a drawing holds up to 150 shapes.
SEE ALSO
desk, wdesk, gl, basic (GRAPHICS), gfx, image
See also: desk, wdesk, gl, basic, gfx, image
The text of man paint on P8X (os/man/paint in the repository). All commands