bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

changes in -back (path.m _stroke:)


From: Enrico Sersale
Subject: changes in -back (path.m _stroke:)
Date: Fri, 14 Jan 2005 03:04:10 +0200


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.

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];
          }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]