diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-29 16:04:12 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-29 16:04:12 +0100 |
commit | e181756fa0fcd4c1c79fc1b84590491106797729 (patch) | |
tree | 75d716919b470ca6c0bc795ebe272e1776c082d0 | |
parent | a30b031eaa5cee9c8033679e2d628531ee2b0831 (diff) |
pose-widget: fix off-by-one
-rw-r--r-- | pose-widget/pose-widget.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/pose-widget/pose-widget.cpp b/pose-widget/pose-widget.cpp index ba5dd29e..33bc24fb 100644 --- a/pose-widget/pose-widget.cpp +++ b/pose-widget/pose-widget.cpp @@ -288,7 +288,7 @@ void pose_transform::project_quad_texture() if (unlikely(orig_depth != const_depth || dest_depth != const_depth)) { - qDebug() << "pose-widget: octopus must be saved as .png with 32 bits pixel"; + qDebug() << "pose-widget: octopus must be saved as .png with 32 bits depth"; qDebug() << "pose-widget: target texture must be ARGB32"; return; } @@ -312,13 +312,13 @@ void pose_transform::project_quad_texture() { { { 0, 0 }, - { ow, 0 }, - { 0, oh }, + { ow-1, 0 }, + { 0, oh-1 }, }, { - { ow, oh }, - vec2(0, oh) - vec2(ow, oh), - vec2(ow, 0) - vec2(ow, oh), + { ow-1, oh-1 }, + vec2(0, oh-1) - vec2(ow-1, oh-1), + vec2(ow-1, 0) - vec2(ow-1, oh-1), } }; @@ -343,9 +343,6 @@ void pose_transform::project_quad_texture() + uv.x() * origs[i][2].y() + uv.y() * origs[i][1].y(); - fx = clamp(fx, 0, ow - 1.95f); - fy = clamp(fy, 0, oh - 1.95f); - //#define BILINEAR_FILTER #if defined BILINEAR_FILTER |