Skip to content

Commit

Permalink
Rotate point object label positions too.
Browse files Browse the repository at this point in the history
  • Loading branch information
IoriBranford committed Dec 8, 2023
1 parent 0c8f53c commit fc1116d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/tiled/objectselectionitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,7 @@ void MapObjectLabel::syncWithMapObject(const MapRenderer &renderer)
bounds = rotateAt(pos, mObject->rotation()).mapRect(bounds);

// Center the object name on the object bounding box
if (mObject->shape() == MapObject::Point) {
// Use a local offset, since point objects don't scale with the view
boundingRect.translate(0, -bounds.height());
mTextPos.ry() -= bounds.height();
} else {
pos = { (bounds.left() + bounds.right()) / 2, bounds.top() };
}
pos = { (bounds.left() + bounds.right()) / 2, bounds.top() };

if (auto mapScene = static_cast<MapScene*>(scene()))
pos += mapScene->absolutePositionForLayer(*mObject->objectGroup());
Expand Down

0 comments on commit fc1116d

Please sign in to comment.