[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: changes in -back (path.m _stroke:)
From: |
Gregory John Casamento |
Subject: |
Re: changes in -back (path.m _stroke:) |
Date: |
Thu, 13 Jan 2005 17:42:42 -0800 (PST) |
Enrico,
--- Enrico Sersale <enrico@dtedu.net> wrote:
>
> In Gorm (GormInternalViewEditor.m) and in GWorkspace (Desktop/DesktopView.m
> and FSNode/FSNIconsView.m) -mouseDown and -mouseDragged: are broken by the
> recent changes in -back (Source/art/path.m _stroke:).
> Both the apps use about the same code to draw a rect that delimits an area
> where the included objects must be selected.
I've noticed this myself. I've been talking to Alex about it. I have a build
from Dec 30 in which it doesn't occur. Alex also claims that he's seen it in
xlib, but I haven't verified this as of yet.
It's possible it could be broken in some common code between xlib/art. We need
to investigate this further.
> The following example is from Gorm but it is actually the same in GWorkspace:
>
> while ([e type] != NSLeftMouseUp)
> {
> p = [self convertPoint: [e locationInWindow] fromView: nil];
>
> x = (p.x >= oldp.x) ? oldp.x : p.x;
> y = (p.y >= oldp.y) ? oldp.y : p.y;
> w = max(p.x, oldp.x) - min(p.x, oldp.x);
> w = (w == 0) ? 1 : w;
> h = max(p.y, oldp.y) - min(p.y, oldp.y);
> h = (h == 0) ? 1 : h;
>
> r = NSMakeRect(x, y, w, h);
>
> if (NSEqualRects(oldRect, NSZeroRect) == NO)
> {
> [verticalImage
> compositeToPoint: NSMakePoint(NSMinX(oldRect),
> NSMinY(oldRect))
> fromRect: NSMakeRect(0.0, 0.0, 1.0, oldRect.size.height)
> operation: NSCompositeCopy];
> [verticalImage
> compositeToPoint: NSMakePoint(NSMaxX(oldRect)-1,
> NSMinY(oldRect))
> fromRect: NSMakeRect(1.0, 0.0, 1.0, oldRect.size.height)
> operation: NSCompositeCopy];
>
> [horizontalImage
> compositeToPoint: NSMakePoint(NSMinX(oldRect),
> NSMinY(oldRect))
> fromRect: NSMakeRect(0.0, 0.0, oldRect.size.width, 1.0)
> operation: NSCompositeCopy];
> [horizontalImage
> compositeToPoint: NSMakePoint(NSMinX(oldRect),
> NSMaxY(oldRect)-1)
> fromRect: NSMakeRect(0.0, 1.0, oldRect.size.width, 1.0)
> operation: NSCompositeCopy];
> }
>
> {
> NSRect wr;
> wr = [self convertRect: r
> toView: nil];
>
> [verticalImage lockFocus];
> NSCopyBits([[self window] gState],
> NSMakeRect(NSMinX(wr), NSMinY(wr),
> 1.0, r.size.height),
> NSMakePoint(0.0, 0.0));
> NSCopyBits([[self window] gState],
> NSMakeRect(NSMaxX(wr)-1, NSMinY(wr),
> 1.0, r.size.height),
> NSMakePoint(1.0, 0.0));
> [verticalImage unlockFocus];
>
> [horizontalImage lockFocus];
> NSCopyBits([[self window] gState],
> NSMakeRect(NSMinX(wr), NSMinY(wr),
> r.size.width, 1.0),
> NSMakePoint(0.0, 0.0));
> NSCopyBits([[self window] gState],
> NSMakeRect(NSMinX(wr), NSMaxY(wr)-1,
> r.size.width, 1.0),
> NSMakePoint(0.0, 1.0));
> [horizontalImage unlockFocus];
> }
>
> [[NSColor darkGrayColor] set];
> NSFrameRect(r);
> oldRect = r;
>
> [[self window] enableFlushWindow];
>
> [[self window] flushWindow];
> [[self window] disableFlushWindow];
>
>
> e = [NSApp nextEventMatchingMask: eventMask
> untilDate: future
> inMode: NSEventTrackingRunLoopMode
> dequeue: YES];
> }
>
>
>
Thanks, GJC
=====
Gregory John Casamento
-- CEO/President Open Logic Corp. (A Maryland Corporation)
#### Maintainer of Gorm for GNUstep.
- changes in -back (path.m _stroke:), Enrico Sersale, 2005/01/13
- Re: changes in -back (path.m _stroke:),
Gregory John Casamento <=
- Re: changes in -back (path.m _stroke:), Enrico Sersale, 2005/01/14
- Re: changes in -back (path.m _stroke:), Alexander Malmberg, 2005/01/14
- Re: changes in -back (path.m _stroke:), Alexander Malmberg, 2005/01/14
- Re: changes in -back (path.m _stroke:), Gregory John Casamento, 2005/01/15
- Re: changes in -back (path.m _stroke:), Alexander Malmberg, 2005/01/15
- Re: changes in -back (path.m _stroke:), Alexander Malmberg, 2005/01/15