From ac4dfd675cdfd23293759878505957459393006f Mon Sep 17 00:00:00 2001 From: ksamak Date: Sun, 26 Mar 2017 13:12:37 +0200 Subject: [PATCH] changed relation type --- plugins/ezoom/src/ezoom.cpp | 64 ----------------------------- plugins/ezoom/src/ezoom.h | 3 -- plugins/showmouse/CMakeLists.txt | 3 +- plugins/showmouse/showmouse.xml.in | 5 ++- plugins/showmouse/src/showmouse.cpp | 5 +-- 5 files changed, 5 insertions(+), 75 deletions(-) diff --git a/plugins/ezoom/src/ezoom.cpp b/plugins/ezoom/src/ezoom.cpp index f5401b375..c7c0b1663 100644 --- a/plugins/ezoom/src/ezoom.cpp +++ b/plugins/ezoom/src/ezoom.cpp @@ -314,70 +314,6 @@ EZoomScreen::adjustXYVelocity (int out, (zooms.at (out).yVelocity * chunk) / cScreen->redrawTime (); } -// correct showmouse's targeting according to mouse centering algorythm -CompPoint -EZoomScreen::getModifiedMousePosition (const CompPoint &p) -{ - int out = screen->outputDeviceForPoint (pointerX, pointerY); - CompOutput *o = &screen->outputDevs ().at (out); - - if (zooms.at (out).newZoom == 1.0f) { - return p; - } - if (optionGetAlwaysCenterMouse()) { - if (optionGetRestrainZoomToScreen()) { - int x_shift = o->width() / 2; - if (o->width() * (0.5f + zooms.at (out).xTranslate) == 0) { - x_shift = static_cast(p.x() / zooms.at (out).newZoom); - } else if (o->width() * (0.5f + zooms.at (out).xTranslate) == o->width() ) { - x_shift = static_cast(o->width() - (o->width() - p.x()) / zooms.at (out).newZoom); - } - int y_shift = o->height() / 2; - if (o->height() * (0.5f + zooms.at (out).yTranslate) == 0) { - y_shift = static_cast(p.y() / zooms.at (out).newZoom); - } else if (o->height() * (0.5f + zooms.at (out).yTranslate) == o->height() ) { - y_shift = static_cast(o->height() - (o->height() - p.y()) / zooms.at (out).newZoom); - } - return {x_shift, y_shift}; - } - return {o->width() / 2, o->height() / 2}; - } - - //float zoomCorrection = 1.0f - zooms.at(out).newZoom; // this correction allows constant centering of the mouse - - // legaly centering algorythm - int x_shift = p.x(); - int y_shift = p.y(); - - // coordinate system conversion - // one lead: - //float x_2 = static_cast(x_shift) / o->width() * (0.92f) + 0.5f; - //float y_2 = static_cast(y_shift) / o->height() * (0.92f) + 0.5f; - - // working ok, but for one variable to find - //float x_2 = static_cast(x_shift) * 1.08f / (o->width()) * 0.92f / zooms.at(out).newZoom +0.5f; - //float y_2 = static_cast(y_shift) * 1.08f / (o->height()) * 0.92f / zooms.at(out).newZoom +0.5f; - //x_shift = (x_2 - 0.5f) * o->width() * (1 - zooms.at(out).newZoom); // + o->width() * 0.08 * (1 - zooms.at(out).newZoom); - //y_shift = (y_2 - 0.5f) * o->height() * (1 - zooms.at(out).newZoom); // + o->height() * 0.08 * (1 - zooms.at(out).newZoom); - - float x_2 = static_cast(x_shift) / (o->width()) * 0.92f / zooms.at(out).newZoom + 0.46f; - float y_2 = static_cast(y_shift) / (o->height()) * 0.92f / zooms.at(out).newZoom +0.46f; - - x_shift = (x_2 - 0.46f) * o->width() * (1 - zooms.at(out).newZoom) + o->width() / 2 * 0.08f; - y_shift = (y_2 - 0.46f) * o->height() * (1 - zooms.at(out).newZoom) + o->height() / 2 * 0.08f; - - std::cout << x_shift << std::endl; - std::cout << ":" << std::endl; - //if (x_shift < o->width()/2) { - // x_shift /= 0.92f; - //} - //if (y_shift < o->height()/2) { - // y_shift /= 0.92f; - //} - return {x_shift, y_shift}; - //return {static_cast((p.x() - o->width()/2) * 0.92f), static_cast((o->height() + p.y()) * 0.92 - o->height())}; -} - /* Animate the movement (if any) in preparation of a paint screen. */ void EZoomScreen::preparePaint (int msSinceLastPaint) diff --git a/plugins/ezoom/src/ezoom.h b/plugins/ezoom/src/ezoom.h index 330b59b85..c50541c10 100644 --- a/plugins/ezoom/src/ezoom.h +++ b/plugins/ezoom/src/ezoom.h @@ -180,9 +180,6 @@ class EZoomScreen : public: - CompPoint - getModifiedMousePosition (const CompPoint &p); - void preparePaint (int); diff --git a/plugins/showmouse/CMakeLists.txt b/plugins/showmouse/CMakeLists.txt index 7ded6c871..9c2897d1b 100644 --- a/plugins/showmouse/CMakeLists.txt +++ b/plugins/showmouse/CMakeLists.txt @@ -1,6 +1,5 @@ find_package (Compiz REQUIRED) include (CompizPlugin) -include_directories (${CMAKE_SOURCE_DIR}/plugins/ezoom/src/) -compiz_plugin (showmouse PLUGINDEPS composite opengl mousepoll INCDIRS LIBRARIES ezoom ) +compiz_plugin (showmouse PLUGINDEPS composite opengl mousepoll) diff --git a/plugins/showmouse/showmouse.xml.in b/plugins/showmouse/showmouse.xml.in index 1490b5f28..32e0d83e0 100644 --- a/plugins/showmouse/showmouse.xml.in +++ b/plugins/showmouse/showmouse.xml.in @@ -8,14 +8,15 @@ opengl mousepoll - ezoom cube decor + + ezoom + opengl mousepoll - ezoom diff --git a/plugins/showmouse/src/showmouse.cpp b/plugins/showmouse/src/showmouse.cpp index 385c71029..928b8d9f6 100644 --- a/plugins/showmouse/src/showmouse.cpp +++ b/plugins/showmouse/src/showmouse.cpp @@ -28,8 +28,6 @@ */ #include "showmouse.h" -#include "ezoom.h" -#include COMPIZ_PLUGIN_20090315 (showmouse, ShowmousePluginVTable); @@ -489,8 +487,7 @@ ShowmouseScreen::doDamageRegion () void ShowmouseScreen::positionUpdate (const CompPoint &p) { - ZOOM_SCREEN (screen); - mousePos = zs->getModifiedMousePosition(p); + mousePos = p; } void -- GitLab