fix one pixel being off and annoying me

This commit is contained in:
vaxerski 2022-03-08 15:42:36 +01:00
parent 89024158a1
commit 0138a072ca
2 changed files with 5 additions and 1 deletions

View File

@ -73,7 +73,8 @@
free(error##name);
#define VECTORDELTANONZERO(veca, vecb) ((int)abs(veca.x - vecb.x) > 0 || (int)abs(veca.y - vecb.y) > 0)
#define VECTORDELTANONZERO(veca, vecb) (abs(veca.x - vecb.x) > 0.4f || abs(veca.y - vecb.y) > 0.4f)
#define VECTORDELTAMORETHAN(veca, vecb, delta) (abs(veca.x - vecb.x) > (delta) || abs(veca.y - vecb.y) > (delta))
#define PROP(cookie, name, len) const auto cookie = xcb_get_property(DisplayConnection, false, window, name, XCB_GET_PROPERTY_TYPE_ANY, 0, len); \
const auto cookie##reply = xcb_get_property_reply(DisplayConnection, cookie, NULL)

View File

@ -84,6 +84,9 @@ void AnimationUtil::move() {
if (!VECTORDELTANONZERO(window.getRealPosition(), window.getEffectivePosition())
&& !VECTORDELTANONZERO(window.getRealSize(), window.getEffectiveSize())) {
window.setIsAnimated(false);
window.setRealSize(window.getEffectiveSize());
window.setRealPosition(window.getEffectivePosition());
}
}