On Tue, 18 Mar 2003 23:14:47 +0100, Simon Budig <[EMAIL PROTECTED]> wrote:
> Branko Collin ([EMAIL PROTECTED]) wrote:
> [CinePaint]
> > The Windows version also comes with a nice mouse pointer the size of 
> > the current brush. Doesn't quite seem to work yet, but very handy.
> Since this pops up again and again, I thought I'd share my thoughts
> on how this might be implemented.
> We could generate an outline of the current brush in the same way as
> we create an outline for the selection. The result would be a
> black/white image that roughly shows the size/shape of an brush.
> (For brush pipes we could simply use the first brush in the pipe or
> combine the black/white for the various brushes. Since the latter would
> be a pretty black image for huge brush pipes a better idea would
> probably be a bounding box or something like that.)
> Changing the X11 Mousepointer itself is most probably not an option,
> since some platforms have a size limit on that pointer (32x32 or so -
> pretty small).

But if the brush is small at screen resolution (size of the brush *
zoom factor), then using the X cursor is the best option because it
will probably be the fastest solution.  So it would be better to
check what is the largest cursor supported by the X display and to use
the cursor for drawing the outline, as long as it fits in the
acceptable dimensions.  Unfortunately, it looks like GDK does not
provide direct access to XQueryBestCursor(), which would be the
correct way to check the sizes accepted by the current display.
Another option is to use gdk_cursor_new_from_pixmap() and check if it

> Also moving an additional shaped window synchronously
> with the mouse pointer sounds like a bad idea to me, since complex
> shaped windows have a big performance impact on the X Server.
> So we could simply XOR the image on the image view window. The
> GimpDrawTool could be extended with functions to draw a bitmap on the
> image and the GimpPaintTool would optionally use this feature to place
> the above mentioned image on the view area.

Some servers are relatively fast at XORing large bitmaps over the
image, but some others are slow.  For other servers, it could be
faster to draw a set of lines showing the outline of the brush (if the
outline is not too complex).  Even for a given server, the optimal
choice can change if the GIMP is used remotely (over the network)
instead of locally.

Also, at some zoom factors, the brush outline could as large as the
screen, or even larger.  Using a bitmask for this could consume too
much memory, while using line segments would not have a big impact.

All these things are summarized in bug #32498:

In particular, check the comment that I posted on 2002-01-08, quoting
Mattias EngdegŚrd about line segments vs. bitmasks.

Gimp-developer mailing list

Reply via email to