From 473a00e64e6f4602e4cc4f707874143da82d58f3 Mon Sep 17 00:00:00 2001 From: Pierre Laborde Date: Wed, 30 Oct 2024 21:14:06 +0100 Subject: [PATCH 1/2] Replace Semaphore by Monitor. --- src/GeoView/AbstractGeoViewGraphicModelLayer.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GeoView/AbstractGeoViewGraphicModelLayer.class.st b/src/GeoView/AbstractGeoViewGraphicModelLayer.class.st index eaf06f8..d6d0de0 100644 --- a/src/GeoView/AbstractGeoViewGraphicModelLayer.class.st +++ b/src/GeoView/AbstractGeoViewGraphicModelLayer.class.st @@ -271,7 +271,7 @@ AbstractGeoViewGraphicModelLayer >> updateDShapes: aDShapeList [ AbstractGeoViewGraphicModelLayer >> userDataChangesMutex [ ^ userDataChangesMutex ifNil: [ - userDataChangesMutex := Semaphore forMutualExclusion ] + userDataChangesMutex := Monitor new ] ] { #category : #'API -- graphic properties' } From ba4d18b42ea9014714befeb3d2f105a999fd7c9f Mon Sep 17 00:00:00 2001 From: Pierre Laborde Date: Thu, 31 Oct 2024 01:41:32 +0100 Subject: [PATCH 2/2] Fix GeoObject recycling. Fix picking on DShapesLayer. --- src/GeoView/GeoObjectProcessData.class.st | 6 +++++- src/GeoView/GeoViewDShapesLayer.class.st | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/GeoView/GeoObjectProcessData.class.st b/src/GeoView/GeoObjectProcessData.class.st index 3abf20e..e165e07 100644 --- a/src/GeoView/GeoObjectProcessData.class.st +++ b/src/GeoView/GeoObjectProcessData.class.st @@ -54,7 +54,11 @@ GeoObjectProcessData >> processRecycledData: aKey incoming: aGeoObject with: aDS aDShape key: nil. aDShape removeProperties. - aDShape isComposite ifTrue:[ aDShape removeChildren ]. + aDShape isComposite ifTrue:[ + aDShape dShapeList removeAll. + aDShape toUpdateDShapeList removeAll. + aDShape toDeleteDShapeList removeAll. + ]. ^ aDShape ] diff --git a/src/GeoView/GeoViewDShapesLayer.class.st b/src/GeoView/GeoViewDShapesLayer.class.st index 25876be..afe85fa 100644 --- a/src/GeoView/GeoViewDShapesLayer.class.st +++ b/src/GeoView/GeoViewDShapesLayer.class.st @@ -70,6 +70,21 @@ GeoViewDShapesLayer >> mapProjection: aMapProjection [ "do nothing" ] +{ #category : #private } +GeoViewDShapesLayer >> populatePickingResult: aPickingResult at: index with: aGShape [ + "Way to detect if the gShape is picked" + + | pickingElement data | + pickingElement := super populatePickingResult: aPickingResult at: index with: aGShape. + pickingElement ifNil:[ ^ nil ]. + + "add dShape" + self userDataChangesMutex critical: [ data := self userModel at: index ifAbsent:[ nil ] ]. + pickingElement dShape: data. + + ^ pickingElement +] + { #category : #'API -- DShapes' } GeoViewDShapesLayer >> removeDShape: aDShape [