You've already forked lazarus-ccr
LazMapViewer: Lock list of gps items during painting.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8006 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -125,8 +125,6 @@ type
|
||||
procedure _Delete(Idx: Integer; var DelLst: TGPSObjList);
|
||||
procedure FreePending;
|
||||
procedure DecRef;
|
||||
procedure Lock;
|
||||
procedure UnLock;
|
||||
procedure CallModified(lst: TGPSObjList; Adding: boolean);
|
||||
// property Items: TGPSObjList read FItems;
|
||||
procedure IdsToObj(const Ids: TIdArray; out objs: TGPSObjArray; AIdOwner: integer);
|
||||
@ -146,6 +144,9 @@ type
|
||||
procedure BeginUpdate;
|
||||
procedure EndUpdate;
|
||||
|
||||
procedure Lock;
|
||||
procedure UnLock;
|
||||
|
||||
property Count: integer read GetCount;
|
||||
property Items[AIndex: Integer]: TGpsObj read GetItem; default;
|
||||
property OnModified: TModifiedEvent read FOnModified write FOnModified;
|
||||
|
@ -617,6 +617,8 @@ var
|
||||
extent: TSize;
|
||||
s: String;
|
||||
begin
|
||||
GPSItems.Lock;
|
||||
try
|
||||
if Assigned(FOnDrawGpsPoint) then begin
|
||||
FOnDrawGpsPoint(Self, DrawingEngine, aPOI);
|
||||
exit;
|
||||
@ -651,6 +653,10 @@ begin
|
||||
end;
|
||||
extent := DrawingEngine.TextExtent(s);
|
||||
DrawingEngine.Textout(Pt.X - extent.CX div 2, Pt.Y + 5, s);
|
||||
|
||||
finally
|
||||
GPSItems.Unlock;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMapView.CallAsyncInvalidate;
|
||||
|
Reference in New Issue
Block a user