From b4b5389bc11e220266e6d41f5f637f0c30ba6239 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 18 Jun 2024 18:17:55 +0200 Subject: [PATCH] Math: add an int ctor to vec --- include/hyprutils/math/Vector2D.hpp | 1 + src/math/Vector2D.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/hyprutils/math/Vector2D.hpp b/include/hyprutils/math/Vector2D.hpp index ecc2fa8..c204035 100644 --- a/include/hyprutils/math/Vector2D.hpp +++ b/include/hyprutils/math/Vector2D.hpp @@ -8,6 +8,7 @@ namespace Hyprutils { class Vector2D { public: Vector2D(double, double); + Vector2D(int, int); Vector2D(); ~Vector2D(); diff --git a/src/math/Vector2D.cpp b/src/math/Vector2D.cpp index d59fe5e..a7f709a 100644 --- a/src/math/Vector2D.cpp +++ b/src/math/Vector2D.cpp @@ -9,6 +9,11 @@ Hyprutils::Math::Vector2D::Vector2D(double xx, double yy) { y = yy; } +Hyprutils::Math::Vector2D::Vector2D(int xx, int yy) { + x = (double)xx; + y = (double)yy; +} + Hyprutils::Math::Vector2D::Vector2D() { x = 0; y = 0;