View Issue Details

IDProjectCategoryView StatusLast Update
0028689LazarusWidgetsetpublic2018-01-31 14:16
ReporterLuiz Americo Assigned ToBalázs Székely  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
OSOSX 
Summary0028689: Device Context Origin is not respected in BitBlt under OSX
DescriptionSetting DC origin through SetWindowOrg and calling BitBlt does not work under OSX

See test app and screenshot of expected result in http://bugs.freepascal.org/view.php?id=25564

 
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetCarbon
Attached Files

Relationships

related to 0008626 closedLuiz Americo Lazarus BitBlt in gtk has different behavior than win32 when the DCOrigin of the source DC is different from 0 
parent of 0025564 assignedLuiz Americo Lazarus CCR Stringgrid drawing is incorrect on Mac 
Not all the children of this issue are yet resolved or closed.

Activities

MIS5

2015-10-05 14:10

reporter   ~0086252

Discussion of this problem found here:
http://forum.lazarus.freepascal.org/index.php/topic,12172.msg189203.html#msg189203

where LuizAmérico suggested where a solution may be found
(including it justt in case someone see this)

MIS5

2015-10-28 03:19

reporter  

fixedosx.jpg (27,874 bytes)   
fixedosx.jpg (27,874 bytes)   

MIS5

2015-10-28 03:20

reporter   ~0086928

It now appears to work for me after Luiz' fix

Luiz Americo

2015-10-29 01:42

developer  

carbon.diff (450 bytes)   
diff --git lcl/interfaces/carbon/carboncanvas.pp lcl/interfaces/carbon/carboncanvas.pp
index d2bfe5b..5a9014d 100644
--- lcl/interfaces/carbon/carboncanvas.pp
+++ lcl/interfaces/carbon/carboncanvas.pp
@@ -1493,6 +1493,10 @@ begin
 
   if Image = nil then Exit;
 
+  //apply window offset
+  XSrc := XSrc - SrcDC.WindowOfs.X;
+  YSrc := YSrc - SrcDC.WindowOfs.Y;
+
   DstRect := CGRectMake(X, Y, Abs(Width), Abs(Height));
 
   SubMask := (Msk <> nil)
carbon.diff (450 bytes)   

Luiz Americo

2015-10-29 01:43

developer   ~0086968

The attached patch should fix the issue according to MIS5. Not tested myself

Balázs Székely

2018-01-09 07:29

developer   ~0105510

Tested and works well. Applied in r.57022. Thanks @Luiz.

Issue History

Date Modified Username Field Change
2015-09-17 15:40 Luiz Americo New Issue
2015-09-17 15:40 Luiz Americo Project Lazarus CCR => Lazarus
2015-09-17 15:42 Luiz Americo LazTarget => -
2015-09-17 15:42 Luiz Americo Widgetset => Carbon
2015-09-17 15:42 Luiz Americo Category LCL => Widgetset
2015-09-17 15:42 Luiz Americo OS => OSX
2015-09-17 15:42 Luiz Americo Relationship added parent of 0025564
2015-09-17 15:42 Luiz Americo Relationship added related to 0008626
2015-10-05 14:10 MIS5 Note Added: 0086252
2015-10-28 03:19 MIS5 File Added: fixedosx.jpg
2015-10-28 03:20 MIS5 Note Added: 0086928
2015-10-29 01:42 Luiz Americo File Added: carbon.diff
2015-10-29 01:43 Luiz Americo Note Added: 0086968
2018-01-08 17:40 Balázs Székely Assigned To => Balázs Székely
2018-01-08 17:40 Balázs Székely Status new => assigned
2018-01-09 07:29 Balázs Székely Note Added: 0105510
2018-01-09 07:29 Balázs Székely Status assigned => resolved
2018-01-09 07:29 Balázs Székely Resolution open => fixed