Author: dpsimons
Date: Wed Nov 25 21:09:24 2015
New Revision: 39201

URL: http://svn.gna.org/viewcvs/gnustep?rev=39201&view=rev
Log:
fix color swatch when dragging color on Windows

Modified:
    libs/gui/branches/gnustep_testplant_branch/ChangeLog
    libs/gui/branches/gnustep_testplant_branch/Source/NSColorPanel.m

Modified: libs/gui/branches/gnustep_testplant_branch/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/ChangeLog?rev=39201&r1=39200&r2=39201&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/ChangeLog        (original)
+++ libs/gui/branches/gnustep_testplant_branch/ChangeLog        Wed Nov 25 
21:09:24 2015
@@ -1,4 +1,10 @@
-2015-11-23  Doug Simons <[email protected]>
+2015-11-25  Doug Simons <[email protected]>
+
+       * Source/NSColorPanel.m: Fix -dragColor:withEvent:fromView: to
+       show a correct color swatch while dragging on Windows (previously
+       the dragged swatch always appeared black).
+
+       2015-11-23  Doug Simons <[email protected]>
 
        * Source/NSColorPanel.m: Improve the user experience when using
        the magnifying glass to select a color from the screen. Also,

Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSColorPanel.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSColorPanel.m?rev=39201&r1=39200&r2=39201&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSColorPanel.m    
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSColorPanel.m    Wed Nov 
25 21:09:24 2015
@@ -533,16 +533,17 @@
          fromView: (NSView *)sourceView
 {
   NSPasteboard *pb = [NSPasteboard pasteboardWithName: NSDragPboard];
-  NSImage      *image = [NSImage imageNamed: @"common_ColorSwatch"];
-  NSSize       size;
+  NSSize       size = NSMakeSize(10,10);
   NSPoint      point;
+  NSImage *image = [[[NSImage alloc] initWithSize:size] autorelease];
+  [image lockFocus];
+  [aColor drawSwatchInRect:NSMakeRect(0, 0, size.width, size.height)];
+  [image unlockFocus];
 
   [pb declareTypes: [NSArray arrayWithObjects: NSColorPboardType, nil]
       owner: aColor];
   [aColor writeToPasteboard: pb];
-  [image setBackgroundColor: aColor];
-
-  size = [image size];
+
   point = [sourceView convertPoint: [anEvent locationInWindow] fromView: nil];
   point.x -= size.width/2;
   point.y -= size.width/2;


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to