View Issue Details

IDProjectCategoryView StatusLast Update
0025338LazarusWidgetsetpublic2013-11-21 00:44
ReporteraccSoneAssigned ToPaul Ishenin 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformdarwin x86_64OSOSXOS Version10.6.8
Product Version1.3 (SVN)Product Build 
Target VersionFixed in Version1.2.0 
Summary0025338: TCanvas.Rectangle doesn't fill with brush color
DescriptionUnlike in carbon and win32 the cocoa widgetset doesn't paint the fill of the rectangle in TCanvas.Rectangle
Steps To ReproducePaint with TCanvas.Rectangle -> no fill
Additional InformationCurrently investigating, fix will follow
TagsNo tags attached.
Fixed in Revision43467
LazTarget-
WidgetsetCocoa
Attached Files
  • fix_0025338.patch (780 bytes)
    Index: /Developer/lazarus_trunc/lcl/interfaces/cocoa/cocoawinapi.inc
    ===================================================================
    --- /Developer/lazarus_trunc/lcl/interfaces/cocoa/cocoawinapi.inc	(revision 43444)
    +++ /Developer/lazarus_trunc/lcl/interfaces/cocoa/cocoawinapi.inc	(working copy)
    @@ -60,9 +60,14 @@
     
     
     function TCocoaWidgetSet.ClientToScreen(Handle: HWND; var P: TPoint): Boolean;
    @@ -1255,7 +1260,10 @@
       ctx := CheckDC(DC);
       Result := Assigned(ctx);
       if Result then
    -    ctx.Rectangle(X1, Y1, X2, Y2, False, nil);
    +    begin
    +      ctx.Rectangle(X1, Y1, X2, Y2, False, nil);
    +      ctx.Rectangle(X1, Y1, X2, Y2, True, ctx.Brush);
    +    end;
     end;
     
     {------------------------------- SYNC OBJECTS ---------------------------------}
    
    fix_0025338.patch (780 bytes)

Activities

accSone

2013-11-20 15:51

developer  

fix_0025338.patch (780 bytes)
Index: /Developer/lazarus_trunc/lcl/interfaces/cocoa/cocoawinapi.inc
===================================================================
--- /Developer/lazarus_trunc/lcl/interfaces/cocoa/cocoawinapi.inc	(revision 43444)
+++ /Developer/lazarus_trunc/lcl/interfaces/cocoa/cocoawinapi.inc	(working copy)
@@ -60,9 +60,14 @@
 
 
 function TCocoaWidgetSet.ClientToScreen(Handle: HWND; var P: TPoint): Boolean;
@@ -1255,7 +1260,10 @@
   ctx := CheckDC(DC);
   Result := Assigned(ctx);
   if Result then
-    ctx.Rectangle(X1, Y1, X2, Y2, False, nil);
+    begin
+      ctx.Rectangle(X1, Y1, X2, Y2, False, nil);
+      ctx.Rectangle(X1, Y1, X2, Y2, True, ctx.Brush);
+    end;
 end;
 
 {------------------------------- SYNC OBJECTS ---------------------------------}
fix_0025338.patch (780 bytes)

Paul Ishenin

2013-11-21 00:44

manager   ~0071454

Your patch forgets about outline around rectangle with current pen. Better to read MSDN when you want to implement some winapi function.

In any case, thanks for the patch. Please test and close if ok.

Issue History

Date Modified Username Field Change
2013-11-20 15:33 accSone New Issue
2013-11-20 15:51 accSone File Added: fix_0025338.patch
2013-11-20 23:56 Paul Ishenin Assigned To => Paul Ishenin
2013-11-20 23:56 Paul Ishenin Status new => assigned
2013-11-21 00:44 Paul Ishenin Fixed in Revision => 43467
2013-11-21 00:44 Paul Ishenin LazTarget => -
2013-11-21 00:44 Paul Ishenin Note Added: 0071454
2013-11-21 00:44 Paul Ishenin Status assigned => resolved
2013-11-21 00:44 Paul Ishenin Fixed in Version => 1.2.0
2013-11-21 00:44 Paul Ishenin Resolution open => fixed