From e181756fa0fcd4c1c79fc1b84590491106797729 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 29 Dec 2017 16:04:12 +0100 Subject: pose-widget: fix off-by-one --- pose-widget/pose-widget.cpp | 15 ++++++--------- 1 file 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 -- cgit v1.2.3