Skip to content

Commit

Permalink
[ui] Fix that the position of comment blocks was not mapped correctly
Browse files Browse the repository at this point in the history
Fix #1379
  • Loading branch information
jcelerier committed Mar 28, 2022
1 parent 1380bed commit 806dd78
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,10 @@ void ScenarioPresenter::fillContextMenu(
menu.addAction(actions.action<Actions::DeselectAll>().action());

auto createCommentAct = new QAction{"Add a Comment Block", &menu};
connect(createCommentAct, &QAction::triggered, [&, scenepos]() {
const auto viewpos = view().mapFromScene(scenepos);
connect(createCommentAct, &QAction::triggered, this, [&, viewpos] {
auto scenPoint = Scenario::ConvertToScenarioPoint(
scenepos, zoomRatio(), view().height());
viewpos, zoomRatio(), view().height());

auto cmd = new Scenario::Command::CreateCommentBlock{
model(), scenPoint.date, scenPoint.y};
Expand Down

0 comments on commit 806dd78

Please sign in to comment.