@maplibre/maplibre-react-native 11.3.0 → 11.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -273,18 +273,16 @@ static double const M2PI = M_PI * 2;
273
273
  NSMutableArray<MLRNSource *> *hitTouchableSources = [[NSMutableArray alloc] init];
274
274
  for (MLRNSource *touchableSource in touchableSources) {
275
275
  NSDictionary<NSString *, NSNumber *> *hitbox = touchableSource.hitbox;
276
- float halfWidth = [hitbox[@"width"] floatValue] / 2.f;
277
- float halfHeight = [hitbox[@"height"] floatValue] / 2.f;
278
-
279
- CGFloat top = screenPoint.y - halfHeight;
280
- CGFloat left = screenPoint.x - halfWidth;
276
+ float top = [hitbox[@"top"] floatValue];
277
+ float right = [hitbox[@"right"] floatValue];
278
+ float bottom = [hitbox[@"bottom"] floatValue];
279
+ float left = [hitbox[@"left"] floatValue];
281
280
  CGRect hitboxRect =
282
- CGRectMake(left, top, [hitbox[@"width"] floatValue], [hitbox[@"height"] floatValue]);
281
+ CGRectMake(screenPoint.x - left, screenPoint.y - top, left + right, top + bottom);
283
282
 
284
283
  NSArray<id<MLNFeature>> *features =
285
284
  [self visibleFeaturesInRect:hitboxRect
286
- inStyleLayersWithIdentifiers:[NSSet setWithArray:[touchableSource getLayerIDs]]
287
- predicate:nil];
285
+ inStyleLayersWithIdentifiers:[NSSet setWithArray:[touchableSource getLayerIDs]]];
288
286
 
289
287
  if (features.count > 0) {
290
288
  hits[touchableSource.id] = features;
@@ -5,13 +5,11 @@
5
5
 
6
6
  @implementation MLRNSource
7
7
 
8
- double const DEFAULT_HITBOX_AREA = 44.0;
9
-
10
8
  - (instancetype)initWithFrame:(CGRect)frame {
11
9
  if (self = [super initWithFrame:frame]) {
12
10
  _layers = [[NSMutableArray alloc] init];
13
11
  _reactSubviews = [[NSMutableArray alloc] init];
14
- _hitbox = @{@"width" : @(DEFAULT_HITBOX_AREA), @"height" : @(DEFAULT_HITBOX_AREA)};
12
+ _hitbox = @{@"top" : @22.0f, @"right" : @22.0f, @"bottom" : @22.0f, @"left" : @22.0f};
15
13
  }
16
14
  return self;
17
15
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maplibre/maplibre-react-native",
3
3
  "description": "React Native library for creating maps with MapLibre Native for Android & iOS",
4
- "version": "11.3.0",
4
+ "version": "11.3.1",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "provenance": true