Skip to content

Commit

Permalink
Fix #3702
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-osm committed May 14, 2024
1 parent c8f19b6 commit 685431d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ - (void) setupView
{
if ([addon.addonId isEqualToString:kId_Addon_TrackRecording_Edit_Waypoint]
&& _iapHelper.trackRecording.isActive
&& (_targetPoint.type == OATargetWpt) && [_targetPoint.targetObj isKindOfClass:[OAGpxWptItem class]]) {
&& (_targetPoint.type == OATargetWpt) && [_targetPoint.targetObj isKindOfClass:[OAGpxWptItem class]] && !((OAGpxWptItem *)_targetPoint.targetObj).routePoint)
{
[arr addObject:@{ @"title" : addon.titleShort,
@"key" : @"addon_edit_waypoint",
@"img" : addon.imageName,
Expand Down
7 changes: 6 additions & 1 deletion Sources/Controllers/Map/Layers/OAGPXLayer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,12 @@ - (void) collectObjectsFromPoint:(CLLocationCoordinate2D)point touchPoint:(CGPoi

- (BOOL) isObjectMovable:(id)object
{
return [object isKindOfClass:OAGpxWptItem.class];
if ([object isKindOfClass:OAGpxWptItem.class])
{
OAGpxWptItem *item = (OAGpxWptItem *)object;
return !item.routePoint;
}
return NO;
}

- (void) applyNewObjectPosition:(id)object position:(CLLocationCoordinate2D)position
Expand Down
9 changes: 5 additions & 4 deletions Sources/Controllers/Map/Layers/OAGPXRecLayer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ - (void) collectObjectsFromPoint:(CLLocationCoordinate2D)point touchPoint:(CGPoi

- (BOOL)isObjectMovable:(id)object
{
BOOL movable = NO;
if ([object isKindOfClass:OAGpxWptItem.class])
movable = ((OAGpxWptItem *)object).docPath == nil;

return movable;
{
OAGpxWptItem *item = (OAGpxWptItem *)object;
return item.docPath == nil && !item.routePoint;
}
return NO;
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ - (void)updateWaypointsData
for (OAWptPt *rtePt in [self.doc getRoutePoints])
{
OAGpxWptItem *rtePtItem = [OAGpxWptItem withGpxWpt:rtePt];
rtePtItem.routePoint = YES;
NSMutableArray<OAGpxWptItem *> *rtePtsGroup = _waypointGroups[OALocalizedString(@"route_points")];
if (!rtePtsGroup)
{
Expand Down
1 change: 1 addition & 0 deletions Sources/Models/OAGpxWptItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@property (nonatomic) NSString* distance;
@property (nonatomic, assign) double distanceMeters;
@property (nonatomic, assign) BOOL selected;
@property (nonatomic, assign) BOOL routePoint;

@property (nonatomic) NSString *docPath;

Expand Down

0 comments on commit 685431d

Please sign in to comment.