-
Notifications
You must be signed in to change notification settings - Fork 18
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
Feature: icon line placement #676
Conversation
WalkthroughThis pull request introduces modifications to several classes related to map vector symbol rendering and positioning. The changes primarily focus on improving the calculation of symbol angles, text positioning, and icon rendering. Key modifications include adjusting the angle calculation in the Changes
Possibly related PRs
Suggested reviewers
Poem
Finishing Touches
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this 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
🧹 Nitpick comments (1)
shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolLabelObject.cpp (1)
680-697
: Consider adding a default case to the switch statement for robustnessWhile all expected
Anchor
enum values are handled in theswitch
statement, adding adefault
case can enhance code robustness by catching any unexpected or invalidtextAnchor
values. This helps prevent potential undefined behavior if new anchor types are introduced in the future.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolGroup.cpp
(1 hunks)shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolLabelObject.cpp
(3 hunks)shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolLabelObject.h
(1 hunks)shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolObject.cpp
(4 hunks)shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolObject.h
(1 hunks)
👮 Files not reviewed due to content moderation or server errors (2)
- shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolObject.cpp
- shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolGroup.cpp
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Build JVM Project / build
- GitHub Check: build
🔇 Additional comments (4)
shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolLabelObject.cpp (2)
860-861
: Correctly settingisPlaced
totrue
when characters are placedThe
isPlaced
flag is appropriately set totrue
whencenterPositions
are not empty, indicating successful placement of text characters.
876-877
: Correctly settingisPlaced
tofalse
when characters are not placedThe
isPlaced
flag is properly set tofalse
whencenterPositions
are empty, reflecting that text characters could not be placed.shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolObject.h (1)
209-209
: Addition of optionalangle
member variable enhances flexibilityThe new member variable
const std::optional<double> angle;
is added correctly, allowing the class to store an optional angle value. This enhances the flexibility for handling rotations or orientations as needed.shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolLabelObject.h (1)
86-88
: New member variableswasReversed
andisPlaced
added appropriatelyThe addition of
bool wasReversed = false;
andbool isPlaced = true;
enhances the state management within the class. These variables are correctly initialized and will assist in tracking the placement and orientation statuses of symbols.
Summary by CodeRabbit
Bug Fixes
New Features
The changes focus on improving the precision and flexibility of map symbol and label rendering, providing more nuanced control over text and icon placement.