aboutsummaryrefslogtreecommitdiff
path: root/src/QuickMedia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/QuickMedia.cpp')
-rw-r--r--src/QuickMedia.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index c735f55..a9eab08 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -3794,14 +3794,6 @@ namespace QuickMedia {
mgl::vec2i prev_mouse_pos;
};
- static mgl::vec2f to_vec2f(mgl::vec2i vec) {
- return mgl::vec2f(vec.x, vec.y);
- }
-
- static mgl::vec2f to_vec2f(mgl::vec2u vec) {
- return mgl::vec2f(vec.x, vec.y);
- }
-
static mgl::vec2f floor(mgl::vec2f vec) {
return { std::floor(vec.x), std::floor(vec.y) };
}
@@ -4052,7 +4044,7 @@ namespace QuickMedia {
navigation_stage = NavigationStage::VIEWING_ATTACHED_IMAGE;
image_control.zoom = 1.0f;
- image_control.offset = to_vec2f(attached_image_texture->get_size()) * 0.5f;
+ image_control.offset = attached_image_texture->get_size().to_vec2f() * 0.5f;
image_control.pressed = window.is_mouse_button_pressed(mgl::Mouse::Left);
image_control.pressed = false;
@@ -4208,14 +4200,14 @@ namespace QuickMedia {
const mgl::vec2i mouse_diff = mgl::vec2i(event.mouse_move.x, event.mouse_move.y) - image_control.prev_mouse_pos;
image_control.prev_mouse_pos.x = event.mouse_move.x;
image_control.prev_mouse_pos.y = event.mouse_move.y;
- image_control.offset -= (to_vec2f(mouse_diff) / image_control.zoom);
+ image_control.offset -= (mouse_diff.to_vec2f() / image_control.zoom);
image_control.moved = true;
idle_active_handler();
} else if(event.type == mgl::Event::KeyPressed) {
if(event.key.code == mgl::Keyboard::W) {
image_control.zoom = 1.0f;
image_control.moved = false;
- image_control.offset = to_vec2f(attached_image_texture->get_size()) * 0.5f;
+ image_control.offset = attached_image_texture->get_size().to_vec2f() * 0.5f;
attached_image_sprite.set_origin(mgl::vec2f(0.0f, 0.0f));
attached_image_sprite.set_scale(mgl::vec2f(1.0f, 1.0f));
}