Skip to content

Commit

Permalink
Rename MapToRoom as MapToAsset
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertBColton committed Sep 2, 2020
1 parent e39f305 commit b1b999a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Editors/PathEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ bool PathEditor::eventFilter(QObject* obj, QEvent* event) {
switch (event->type()) {
case QEvent::MouseMove: {
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);
QPoint roomPos = _ui->pathPreviewBackground->MapToRoom(mouseEvent->pos());
QPoint roomPos = _ui->pathPreviewBackground->MapToAsset(mouseEvent->pos());
MouseMoved(roomPos.x(), roomPos.y());
break;
}
Expand Down
2 changes: 1 addition & 1 deletion Editors/RoomEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ bool RoomEditor::eventFilter(QObject* obj, QEvent* event) {
switch (event->type()) {
case QEvent::MouseMove: {
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);
QPoint roomPos = _ui->roomPreviewBackground->MapToRoom(mouseEvent->pos());
QPoint roomPos = _ui->roomPreviewBackground->MapToAsset(mouseEvent->pos());
const GridDimensions g = _ui->roomView->GetGrid();
cursorPositionLabel->setText(
tr("X %0, Y %1")
Expand Down
2 changes: 1 addition & 1 deletion Widgets/AssetScrollAreaBackground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ QPoint AssetScrollAreaBackground::GetCenterOffset() {
(rect().height() < _assetView->rect().height()) ? 0 : rect().center().y() - _assetView->rect().center().y());
}

QPoint AssetScrollAreaBackground::MapToRoom(const QPoint &pos) const {
QPoint AssetScrollAreaBackground::MapToAsset(const QPoint &pos) const {
return (pos - _totalDrawOffset) / _currentZoom;
}

Expand Down
4 changes: 2 additions & 2 deletions Widgets/AssetScrollAreaBackground.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class AssetScrollAreaBackground : public QWidget {
bool GetGridVisible();
QPoint GetCenterOffset();
// maps a point on the asset scroll area background (e.g, from mouse event)
// into the room with scaling by the zoom and translation
QPoint MapToRoom(const QPoint &pos) const;
// into the asset with scaling by the zoom and translation
QPoint MapToAsset(const QPoint &pos) const;

public slots:
void SetZoom(qreal _currentZoom);
Expand Down

0 comments on commit b1b999a

Please sign in to comment.