diff --git a/src/control/tools/EditSelection.cpp b/src/control/tools/EditSelection.cpp index c1d8b2e6..03fbdf99 100644 --- a/src/control/tools/EditSelection.cpp +++ b/src/control/tools/EditSelection.cpp @@ -248,7 +248,7 @@ auto EditSelection::getSourceLayer() -> Layer* { return this->sourceLayer; } */ auto EditSelection::getXOnViewAbsolute() -> int { double zoom = view->getXournal()->getZoom(); - return this->view->getX() + this->getXOnView() * zoom; + return this->view->getX() + static_cast(this->getXOnView() * zoom); } /** @@ -256,7 +256,7 @@ auto EditSelection::getXOnViewAbsolute() -> int { */ auto EditSelection::getYOnViewAbsolute() -> int { double zoom = view->getXournal()->getZoom(); - return this->view->getY() + this->getYOnView() * zoom; + return this->view->getY() + static_cast(this->getYOnView() * zoom); } /** @@ -561,7 +561,7 @@ void EditSelection::mouseMove(double mouseX, double mouseY, bool alt) { if (v && v != this->view) { XournalView* xournal = this->view->getXournal(); - auto pageNr = xournal->getControl()->getDocument()->indexOf(v->getPage()); + const auto pageNr = xournal->getControl()->getDocument()->indexOf(v->getPage()); xournal->pageSelected(pageNr); @@ -609,7 +609,7 @@ auto EditSelection::getPageViewUnderCursor() -> XojPageView* { Layout* layout = gtk_xournal_get_layout(this->view->getXournal()->getWidget()); - XojPageView* v = layout->getPageViewAt(hx, hy); + XojPageView* v = layout->getPageViewAt(static_cast(hx), static_cast(hy)); return v; } @@ -941,7 +941,7 @@ void EditSelection::serialize(ObjectOutputStream& out) { this->contents->serialize(out); out.endObject(); - out.writeInt(this->getElements()->size()); + out.writeInt(static_cast(this->getElements()->size())); for (Element* e: *this->getElements()) { e->serialize(out); } } diff --git a/src/control/tools/EditSelection.h b/src/control/tools/EditSelection.h index b0ebbbad..d8a4be26 100644 --- a/src/control/tools/EditSelection.h +++ b/src/control/tools/EditSelection.h @@ -314,7 +314,7 @@ private: // DATA /** * Mouse coordinates for moving / resizing */ - CursorSelectionType mouseDownType; + CursorSelectionType mouseDownType = CURSOR_SELECTION_NONE; double relMousePosX{}; double relMousePosY{}; double relMousePosRotX{};