Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.4.0 #638

Merged
merged 13 commits into from
Aug 15, 2024
Merged

Release 2.4.0 #638

merged 13 commits into from
Aug 15, 2024

Conversation

maurhofer-ubique
Copy link
Contributor

@maurhofer-ubique maurhofer-ubique commented Aug 15, 2024

Summary by CodeRabbit

  • New Features

    • Introduced functionality for pass masking for single polygons and improved handling in non-tile-masked contexts.
    • Enhanced gesture handling for iOS mac applications.
    • Added zoom functionality in coordinate transformation methods.
    • Improved gesture recognition for pinch and pan on macOS.
  • Bug Fixes

    • Resolved issues related to pass masking and rendering performance.
    • Enhanced operational reliability in pause and resume handling within the scheduling system.
  • Documentation

    • Updated changelog to reflect new version entry 2.4.0 and summarized enhancements and fixes.
  • Chores

    • Upgraded Android Gradle Plugin and Kotlin versions for better compatibility and performance.

Copy link
Contributor

coderabbitai bot commented Aug 15, 2024

Walkthrough

The recent updates to the Open Mobile Maps project introduce significant enhancements, particularly in rendering and scheduling functionalities. Notable improvements include support for pass masking in OpenGL, refined gesture handling for macOS applications, and upgraded dependencies for better performance. The integration of zoom handling in coordinate transformations enriches user interactions with maps. Overall, these changes enhance both the operational reliability and user experience of the software.

Changes

Files Change Summary
CHANGELOG.md Updated to include version 2.4.0 with new features like pass masking for single polygons and improvements in gesture handling and scheduling.
Package.swift Modified header search paths for better build configuration, enhancing clarity and efficiency.
android/build.gradle Upgraded AGP and Kotlin versions to improve compatibility and performance.
android/gradle.properties Incremented version name and code to reflect the new release.
android/gradle/wrapper/gradle-wrapper.properties Updated Gradle distribution URL to version 8.2 for enhanced build capabilities.
android/readme.md Updated dependency version for mapscore library from 2.3.0 to 2.4.0 for new features.
bridging/android/java/io/openmobilemaps/mapscore/shared/map/MapCamera2dInterface.kt Added methods for zoom-aware coordinate transformations, enhancing mapping accuracy.
bridging/android/jni/map/NativeMapCamera2dInterface.cpp Introduced JNI functions for zoom handling in coordinate transformations.
bridging/ios/MCMapCamera2dInterface+Private.mm Added zoom-aware methods for converting between screen positions and coordinates.
bridging/ios/MCMapCamera2dInterface.h Declared new methods for zoom-aware transformations, improving usability.
djinni/map/core.djinni Added new methods to the map_camera_2d_interface for zoom handling in coordinate conversions.
ios/graphics/Model/Polygon/Polygon2d.swift Enhanced rendering logic by introducing a stencil state for masked rendering operations.
ios/maps/MCMapView.swift Added gesture recognizers for macOS to improve user interaction.
ios/maps/MCMapViewTouchHandler.swift Removed distance calculation methods and introduced dedicated gesture handling methods for pan and pinch interactions.
shared/public/CollisionGrid.h Updated logic to ensure safe calculations for grid cell counts, preventing undefined behavior.
shared/public/MapCamera2dInterface.h Introduced zoom-aware methods for coordinate transformations.
shared/src/map/scheduling/ThreadPoolSchedulerImpl.cpp Enhanced task scheduling logic with a paused state for better control over task execution.
shared/src/map/scheduling/ThreadPoolSchedulerImpl.h Added a new atomic boolean variable to indicate whether the scheduler is paused.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant MCMapView
    participant GestureHandler
    participant MapCamera

    User->>MCMapView: Interact with map
    MCMapView->>GestureHandler: Recognize gesture (pinch/pan)
    GestureHandler->>MapCamera: Adjust zoom or position
    MapCamera-->>MCMapView: Update view based on gesture
Loading

🐰 In the world of code where rabbits hop,
Changes abound, and we never stop!
With zoom and gestures, the maps will sing,
Enhancing the joy that new features bring!
So let’s dance with pixels, let’s twirl and play,
Celebrating our updates in a bouncy way! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (4)
CHANGELOG.md (1)

8-8: Correct capitalization for "Mac".

The term "mac" should be capitalized as "Mac" to refer to Apple's computer.

- Improving gesture handling for iOS mac apps
+ Improving gesture handling for iOS Mac apps
Tools
LanguageTool

[grammar] ~8-~8: Did you mean Apple’s computer “Mac” (= trademark, capitalized)?
Context: ...id - Improving gesture handling for iOS mac apps - Other fixes and stability imrpov...

(APPLE_PRODUCTS)

djinni/map/core.djinni (2)

165-165: Enhance documentation for coord_from_screen_position_zoom.

Consider adding documentation to describe the purpose and parameters of coord_from_screen_position_zoom, especially how the zoom factor influences the coordinate conversion.


168-168: Enhance documentation for screen_pos_from_coord_zoom.

Consider adding documentation to describe the purpose and parameters of screen_pos_from_coord_zoom, particularly how the zoom factor affects screen position calculation.

Package.swift (1)

141-178: Header Search Paths Do Not Match Current Directory Structure

The header search paths specified in Package.swift do not correspond to any existing directories under src. This suggests that the paths may be outdated or incorrect given the current project structure.

  • Verify and update the header search paths in Package.swift to align with the actual directory structure.
  • Ensure that all necessary headers are correctly included in the project.
Analysis chain

Verify the correctness of header search paths.

The updated header search paths in Package.swift improve specificity. Ensure these paths correctly reflect the current project structure and include all necessary headers.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of updated header search paths in the project.

# Test: Check if the specified directories exist. Expect: All directories should be present.
fd --type d --exact-depth 1 'src' | grep -E 'external/pugixml|external/gpc|logger|map/layers/tiled/vector/sublayers|map/layers/polygon'

Length of output: 135


Script:

#!/bin/bash
# Description: Verify the existence of updated header search paths in the project.

# Test: Check if the specified directories exist at any depth under 'src'.
fd --type d 'src' | grep -E 'external/pugixml|external/gpc|logger|map/layers/tiled/vector/sublayers|map/layers/polygon'

Length of output: 119


Script:

#!/bin/bash
# Description: List all directories under 'src' to verify the existence and correct naming of header search paths.

# List all directories under 'src' to manually verify against expected paths.
fd --type d 'src'

Length of output: 42

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9af3456 and e2073e5.

Files selected for processing (29)
  • CHANGELOG.md (1 hunks)
  • Package.swift (1 hunks)
  • android/build.gradle (1 hunks)
  • android/gradle.properties (1 hunks)
  • android/gradle/wrapper/gradle-wrapper.properties (1 hunks)
  • android/readme.md (3 hunks)
  • bridging/android/java/io/openmobilemaps/mapscore/shared/map/MapCamera2dInterface.kt (2 hunks)
  • bridging/android/jni/map/NativeMapCamera2dInterface.cpp (2 hunks)
  • bridging/ios/MCMapCamera2dInterface+Private.mm (1 hunks)
  • bridging/ios/MCMapCamera2dInterface.h (1 hunks)
  • djinni/map/core.djinni (1 hunks)
  • ios/graphics/Model/Polygon/Polygon2d.swift (3 hunks)
  • ios/maps/MCMapView.swift (2 hunks)
  • ios/maps/MCMapViewTouchHandler.swift (3 hunks)
  • ios/readme.md (1 hunks)
  • shared/public/CollisionGrid.h (1 hunks)
  • shared/public/MapCamera2dInterface.h (1 hunks)
  • shared/public/Tiled2dMapVersionedTileInfo.h (1 hunks)
  • shared/public/Value.h (1 hunks)
  • shared/src/MapsCoreSharedModule.cpp (1 hunks)
  • shared/src/graphics/Renderer.cpp (3 hunks)
  • shared/src/map/MapScene.cpp (2 hunks)
  • shared/src/map/camera/MapCamera2d.cpp (3 hunks)
  • shared/src/map/camera/MapCamera2d.h (1 hunks)
  • shared/src/map/layers/text/TextHelper.cpp (2 hunks)
  • shared/src/map/layers/tiled/vector/geojson/GeoJsonHelperInterface.cpp (1 hunks)
  • shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolLabelObject.cpp (1 hunks)
  • shared/src/map/scheduling/ThreadPoolSchedulerImpl.cpp (5 hunks)
  • shared/src/map/scheduling/ThreadPoolSchedulerImpl.h (1 hunks)
Files skipped from review due to trivial changes (5)
  • android/gradle.properties
  • shared/public/Value.h
  • shared/src/MapsCoreSharedModule.cpp
  • shared/src/map/layers/text/TextHelper.cpp
  • shared/src/map/layers/tiled/vector/geojson/GeoJsonHelperInterface.cpp
Additional context used
LanguageTool
CHANGELOG.md

[grammar] ~8-~8: Did you mean Apple’s computer “Mac” (= trademark, capitalized)?
Context: ...id - Improving gesture handling for iOS mac apps - Other fixes and stability imrpov...

(APPLE_PRODUCTS)

Markdownlint
android/readme.md

185-185: Column: 1
Hard tabs

(MD010, no-hard-tabs)


186-186: Column: 1
Hard tabs

(MD010, no-hard-tabs)


327-327: Column: 1
Hard tabs

(MD010, no-hard-tabs)


328-328: Column: 1
Hard tabs

(MD010, no-hard-tabs)

Additional comments not posted (53)
android/gradle/wrapper/gradle-wrapper.properties (1)

16-16: Verify compatibility with Gradle 8.2.

The update to Gradle 8.2 should be verified for compatibility with existing build scripts and plugins used in the project. Ensure that there are no deprecated features or breaking changes affecting the build process.

shared/public/Tiled2dMapVersionedTileInfo.h (1)

47-47: LGTM! Verify compatibility of tileVersion usage.

The change to use size_t for hashing tileVersion is appropriate. Ensure that all uses of tileVersion in the codebase are compatible with size_t, especially if they previously assumed an int type.

Verification successful

Verified: tileVersion is consistently used as size_t.

The change to use size_t for tileVersion is compatible throughout the file Tiled2dMapVersionedTileInfo.h. All occurrences align with this type, confirming the appropriateness of the change. No further issues found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all uses of `tileVersion` are compatible with `size_t`.

# Test: Search for `tileVersion` usage in the codebase.
# Expect: All occurrences are compatible with `size_t`.
rg --type cpp 'tileVersion'

Length of output: 795

shared/src/map/scheduling/ThreadPoolSchedulerImpl.h (1)

77-77: LGTM! Verify integration of paused variable.

The addition of the paused variable enhances task scheduling control. Ensure that this variable is correctly integrated and utilized in the class methods to manage task execution appropriately.

Verification successful

Integration of paused variable verified.

The paused variable is well-integrated into the task scheduling logic of ThreadPoolSchedulerImpl. It is used in several conditional checks and assignments, effectively controlling task execution flow.

  • Verified usage in conditional checks and assignments within the implementation file.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration of the `paused` variable in the class methods.

# Test: Search for the usage of `paused` in the class methods.
# Expect: Proper integration and usage in task scheduling logic.
rg --type cpp 'paused' shared/src/map/scheduling/ThreadPoolSchedulerImpl.h

Length of output: 110


Script:

#!/bin/bash
# Description: Verify the integration of the `paused` variable in the implementation file.

# Find the implementation file for ThreadPoolSchedulerImpl.
fd 'ThreadPoolSchedulerImpl' --type f --extension cpp --exec rg --type cpp 'paused' {}

Length of output: 366

shared/src/graphics/Renderer.cpp (3)

35-35: Consolidate stencil condition checks.

The introduction of usesStencil simplifies the condition checks for stencil operations. This change improves code readability and potentially enhances performance by reducing redundant checks.


45-48: Verify stencil operations logic.

The logic for handling stencil operations now depends on usesStencil. Ensure that this change correctly reflects the intended behavior and that no scenarios are missed.

Verification successful

Stencil Operations Logic Verified

The logic for handling stencil operations using usesStencil is correctly implemented. The conditions for stencil operations are appropriately defined and used, ensuring no scenarios are missed. The change reflects the intended behavior.

  • usesStencil is defined based on hasMask and isPassMasked, ensuring stencil operations are only performed when necessary.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness of stencil operations logic.

# Test: Search for the usage of `preRenderStencilMask` and `postRenderStencilMask`.
# Expect: Correct usage of `usesStencil` and no missed scenarios.
rg --type cpp -A 5 $'preRenderStencilMask|postRenderStencilMask'

Length of output: 9657


Script:

#!/bin/bash
# Description: Verify the definition and usage of `usesStencil` to ensure no scenarios are missed.

# Search for the definition of `usesStencil` and its usage in the codebase.
rg --type cpp -A 5 'usesStencil'

Length of output: 1370


65-65: Ensure stencil operations are properly closed.

The call to postRenderStencilMask is conditioned on usesStencil. Verify that stencil operations are correctly initiated and concluded in all cases.

Verification successful

Stencil operations are properly closed.

The stencil operations are correctly initiated and concluded across the codebase. The use of glEnable(GL_STENCIL_TEST) and glDisable(GL_STENCIL_TEST) ensures that stencil operations are managed properly.

  • OpenGlContext.cpp: Stencil operations are enabled and disabled correctly.
  • LineGroup2dOpenGl.cpp: Stencil operations are also managed correctly here.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Ensure stencil operations are properly closed.

# Test: Search for the usage of `postRenderStencilMask`.
# Expect: Proper closure of stencil operations in all relevant scenarios.
rg --type cpp -A 5 $'postRenderStencilMask'

Length of output: 6227


Script:

#!/bin/bash
# Search for stencil test enabling to ensure it is paired with postRenderStencilMask
rg --type cpp -A 5 $'glEnable(GL_STENCIL_TEST)'

Length of output: 48


Script:

#!/bin/bash
# Search for any stencil-related operations to verify if stencil operations are used and properly closed
rg --type cpp -A 5 $'STENCIL'

Length of output: 2776

bridging/ios/MCMapCamera2dInterface.h (2)

87-88: Add method for coordinate transformation with zoom.

The method coordFromScreenPositionZoom is a valuable addition for handling coordinate transformations with zoom consideration. Ensure that it integrates well with the existing interface.


92-93: Add method for screen position conversion with zoom.

The method screenPosFromCoordZoom complements the interface by enabling conversion of coordinates to screen positions with zoom consideration. This addition is consistent with existing functionality.

shared/public/MapCamera2dInterface.h (2)

80-81: Add virtual method for coordinate transformation with zoom.

The virtual method coordFromScreenPositionZoom enhances the interface by allowing coordinate transformations with zoom consideration. Ensure implementations adhere to this new method.


84-85: Add virtual method for screen position conversion with zoom.

The virtual method screenPosFromCoordZoom is a valuable addition for converting coordinates to screen positions with zoom consideration. This aligns well with existing interface methods.

android/build.gradle (1)

20-22: Version updates approved. Verify compatibility.

The updates to AGP, Kotlin, and KSP versions are straightforward. Ensure that the rest of the project is compatible with these new versions and that any new features or deprecations are addressed.

ios/graphics/Model/Polygon/Polygon2d.swift (2)

23-24: Introduction of renderPassStencilState approved.

The addition of renderPassStencilState enhances the management of stencil states during rendering operations.


Line range hint 35-73:
Enhancements to render method approved. Verify rendering performance.

The updates to the render method improve handling of masked rendering passes. Ensure that these changes do not negatively impact rendering performance.

ios/maps/MCMapViewTouchHandler.swift (3)

78-100: Ensure comprehensive testing for handlePan.

The handlePan method effectively handles pan gestures by mapping gesture states to touch events. Ensure that this functionality is thoroughly tested across different gesture scenarios to maintain robustness.


102-144: Ensure comprehensive testing for handlePinch.

The handlePinch method manages pinch gestures, converting them into touch events. Verify that this method is tested for various pinch scales and positions to ensure accurate touch event generation.


161-174: Review the private extensions for touch conversion.

The extensions for converting UITouch and CGPoint arrays into touch events encapsulate functionality well. Ensure that these conversions are accurate and consistent with the expected touch event data.

shared/src/map/camera/MapCamera2d.h (2)

124-124: Addition of coordFromScreenPositionZoom method.

The new method coordFromScreenPositionZoom enhances the class by allowing coordinate conversion with a zoom factor. Ensure that this method is implemented in derived classes.


128-128: Addition of screenPosFromCoordZoom method.

The new method screenPosFromCoordZoom provides functionality to convert coordinates to screen positions with zoom consideration. Verify its implementation in derived classes.

shared/src/map/scheduling/ThreadPoolSchedulerImpl.cpp (9)

35-37: Conditional notification for delayed tasks.

The notification to delayedTasksCv is now conditional on the paused state. This prevents unnecessary wake-ups when the scheduler is paused, improving efficiency.


55-57: Conditional notification for default tasks.

The notification to defaultCv is gated by the paused flag, ensuring no tasks are processed when paused. This change enhances task scheduling control.


100-100: Introduction of paused state in pause method.

The paused flag is set to true, effectively pausing task execution. This addition allows for better control over the task lifecycle.


104-106: Resuming tasks with notifications.

The resume method clears the paused state and notifies all waiting threads. This ensures tasks can resume processing efficiently.


155-157: Handling paused state in scheduler thread.

The main loop now checks the paused state, skipping task execution when paused. This prevents unnecessary task processing.


160-160: Loop condition updated for paused state.

The while loop condition now includes a check for paused, ensuring tasks are not executed when the scheduler is paused.


225-225: Detaching thread upon termination.

The makeDelayedTasksThread method detaches the thread if terminated, ensuring proper cleanup and resource management.


232-234: Checking paused state in delayed tasks thread.

The loop in makeDelayedTasksThread now checks the paused state, preventing task execution when paused. This maintains consistency with the main scheduler thread.


236-236: Iterating over delayed tasks with pause check.

The iteration over delayed tasks includes a check for paused, ensuring tasks are not scheduled when the scheduler is paused.

bridging/ios/MCMapCamera2dInterface+Private.mm (2)

250-257: Addition of coordFromScreenPositionZoom method.

The method coordFromScreenPositionZoom enhances the interface by allowing conversion with zoom consideration. Exception handling ensures robustness.


266-273: Addition of screenPosFromCoordZoom method.

The method screenPosFromCoordZoom provides functionality to convert coordinates to screen positions with zoom consideration. The use of exception handling is commendable.

ios/maps/MCMapView.swift (6)

328-350: Gesture recognizers setup for macOS is well-implemented.

The method setupMacGestureRecognizersIfNeeded correctly configures pinch and pan gestures for macOS. The use of require(toFail:) ensures proper gesture interaction.


352-354: Simultaneous gesture recognition is correctly enabled.

The method gestureRecognizer(_:shouldRecognizeSimultaneouslyWith:) correctly allows simultaneous gesture recognition by returning true.


356-358: Gesture recognition initiation is correctly configured.

The method gestureRecognizerShouldBegin correctly allows gestures to begin by returning true.


360-362: Pinch gesture handling is correctly delegated.

The method pinched correctly delegates pinch gesture handling to touchHandler.handlePinch.


364-366: Pan gesture handling is correctly delegated.

The method panned correctly delegates pan gesture handling to touchHandler.handlePan.


Line range hint 368-387: Map readiness callback handling is well-implemented.

The class MCMapViewMapReadyCallbacks correctly implements map readiness callbacks with appropriate synchronization using semaphores.

ios/readme.md (1)

34-34: Version update for maps-core dependency is appropriate.

The update from version 2.3.0 to 2.4.0 for the maps-core dependency aligns with the release objectives and ensures the use of the latest features and fixes.

android/readme.md (3)

68-68: Version update for mapscore dependency is appropriate.

The update from version 2.3.0 to 2.4.0 for the mapscore dependency ensures the use of the latest features and fixes, aligning with the release objectives.


327-328: Enhancements in line rendering options are well-implemented.

The addition of dotted and dottedSkew properties to the Line object enhances line rendering options, allowing more control over visual representation.

Tools
Markdownlint

327-327: Column: 1
Hard tabs

(MD010, no-hard-tabs)


328-328: Column: 1
Hard tabs

(MD010, no-hard-tabs)


185-186: Verify changes in getZoomInfo parameters.

The reduction of numDrawPreviousLayers from 10 to 2 and setting numDrawPreviousOrLaterTLayers to 0 may impact performance and visual output. Ensure these changes align with the intended behavior.

Tools
Markdownlint

185-185: Column: 1
Hard tabs

(MD010, no-hard-tabs)


186-186: Column: 1
Hard tabs

(MD010, no-hard-tabs)

shared/public/CollisionGrid.h (1)

58-59: Ensure Robustness with Conditional Checks.

The added conditional checks for cellSize ensure that division operations are safe and prevent potential division by zero errors. This enhances the robustness of the code.

shared/src/map/MapScene.cpp (2)

391-392: Synchronize Scheduler State in resume().

The addition of scheduler->resume() ensures that the scheduler's state is updated before resuming the layers. This synchronization is crucial for maintaining consistent state management.


412-413: Synchronize Scheduler State in pause().

The addition of scheduler->pause() ensures that the scheduler's state is updated after pausing the layers. This helps maintain consistent state management across the scene.

bridging/android/java/io/openmobilemaps/mapscore/shared/map/MapCamera2dInterface.kt (4)

73-74: Enhance Precision with Zoom Parameter in coordFromScreenPositionZoom.

The new method coordFromScreenPositionZoom allows for coordinate transformations with a zoom factor, enhancing precision in mapping operations.


77-78: Enhance Precision with Zoom Parameter in screenPosFromCoordZoom.

The new method screenPosFromCoordZoom facilitates screen position transformations with a zoom factor, improving precision in graphical applications.


280-285: Implement Native Function for coordFromScreenPositionZoom.

The implementation of coordFromScreenPositionZoom ensures that the method is only used on non-destroyed objects, maintaining integrity and extending functionality.


292-297: Implement Native Function for screenPosFromCoordZoom.

The implementation of screenPosFromCoordZoom includes assertions to ensure operations are performed on valid objects, maintaining integrity while extending capabilities.

bridging/android/jni/map/NativeMapCamera2dInterface.cpp (2)

283-291: Ensure Exception Safety in JNI Function: native_1coordFromScreenPositionZoom.

The function correctly wraps the logic in a try-catch block with JNI_TRANSLATE_EXCEPTIONS_RETURN. This ensures that any C++ exceptions are translated into JNI exceptions, maintaining robustness in the JNI interface.


302-310: Ensure Exception Safety in JNI Function: native_1screenPosFromCoordZoom.

This function also uses a try-catch block with JNI_TRANSLATE_EXCEPTIONS_RETURN, ensuring that exceptions are properly handled and translated into JNI exceptions.

shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolLabelObject.cpp (1)

190-190: Robustness Improvement: Skip Negative Glyph Indices.

The addition of if (i.glyphIndex < 0) continue; effectively prevents processing invalid glyph indices, enhancing the robustness of the glyph handling logic and preventing potential runtime errors.

shared/src/map/camera/MapCamera2d.cpp (4)

Line range hint 787-799: Enhanced Functionality: coordFromScreenPositionZoom.

This method now includes a zoom parameter, allowing for more precise coordinate transformations that account for zoom levels. The use of trigonometric functions and coordinate adjustments appears correct.


804-806: Consistent Zoom Handling: Updated coordFromScreenPosition.

This method now delegates to coordFromScreenPositionZoom, ensuring consistent application of zoom across coordinate transformations.


Line range hint 808-835: New Method: screenPosFromCoordZoom.

This method introduces zoom handling in the conversion from coordinates to screen positions. It correctly uses trigonometric transformations and ensures that the zoom factor is applied.


837-839: Consistent Zoom Handling: Updated screenPosFromCoord.

This method now calls screenPosFromCoordZoom, ensuring that zoom is consistently applied in screen position calculations.

@maurhofer-ubique maurhofer-ubique merged commit b2e8a8d into main Aug 15, 2024
2 checks passed
@maurhofer-ubique maurhofer-ubique deleted the release/2.4.0 branch August 15, 2024 13:10
@coderabbitai coderabbitai bot mentioned this pull request Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants