[Lazarus] TArrow, help for graph primitives needed

zeljko zeljko at holobit.net
Tue Apr 30 14:09:46 CEST 2013


On 04/30/2013 01:45 PM, zeljko wrote:
> On 04/30/2013 12:11 PM, Juha Manninen wrote:
>
>> Unfortunately it only works on Windows. FillRgn does not work with
>> GTK2 and it crashes with QT. Apparently it is not properly
>> implemented.
>> Could somebody graphics oriented please look at TWSArrow and maybe fix
>> it.
>
> Ok, I've fixed Qt so it does not crash, but before commit: it seem that
> there's typo in newarrow define (drawArrow function).
> When you call FillRgn() you call it with Pen.Reference.Handle, instead
> of Brush.Reference.Handle of canvas, so that's one of the reasons why qt
> crashes (brush is NULL). MSDN says that 3rd param should be brush , not
> pen.

Yes, there's nothing to touch in gtk2 or qt. Your new code should be fixed.
1.Must change Pen.Reference to Brush.Reference
2.Must change color of brush to eg. clBlack
3.Must reset brush style to old style/color
So, we should decide to use ACanvas.Brush (and change it's properties, 
but restore it after FillRgn) or create new brush , use it for FillRgn, 
and then destroy it.

And then arrows are ok.

z.





More information about the Lazarus mailing list