You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TCustomWordsItem OnClick event can trigger sending an out of date argument to the OnClick event handler.
(Skia4Delphi 6.0.0-beta3 on windows, Delphi 11.3)
In my specific example the OnClick handler rebuilds the contents of the SkLabel. If the mouse is clicked again without moving the next OnClick event call will be called with a TCustomWordsItem that is no longer valid. It results in faulty data or an exception. I suspect that FWordsMouseOver is not updated if the mouse does not move.
This solution works for me:
FMX.Skia row 5234
procedureTSkLabel.Click;
var
LClickedItem: TCustomWordsItem;
begin
LClickedItem := GetWordsItemAtPosition(FClickedPosition.X, FClickedPosition.Y);
if Assigned(LClickedItem) and (LClickedItem = GetWordsItemAtPosition(PressedPosition.X, PressedPosition.Y)) thenbegin
TMessageManager.DefaultManager.SendMessage(Self, TItemClickedMessage.Create(LClickedItem));
if Assigned(LClickedItem.OnClick) then//LClickedItem.OnClick(FWordsMouseOver)
LClickedItem.OnClick(LClickedItem)
elseinherited;
endelseinherited;
end;
The text was updated successfully, but these errors were encountered:
The TCustomWordsItem OnClick event can trigger sending an out of date argument to the OnClick event handler.
(Skia4Delphi 6.0.0-beta3 on windows, Delphi 11.3)
In my specific example the OnClick handler rebuilds the contents of the SkLabel. If the mouse is clicked again without moving the next OnClick event call will be called with a TCustomWordsItem that is no longer valid. It results in faulty data or an exception. I suspect that FWordsMouseOver is not updated if the mouse does not move.
This solution works for me:
FMX.Skia row 5234
The text was updated successfully, but these errors were encountered: