Commit ed7529b2 authored by Mathieu Faverge's avatar Mathieu Faverge

Fix issue in block dimensions

parent bdba6e92
#include <assert.h> #include <assert.h>
#include <math.h>
#include "Zooming.hpp" #include "Zooming.hpp"
#include "../Helper.hpp" #include "../Helper.hpp"
...@@ -91,10 +92,9 @@ void Zooming::move(double xStart, double xEnd, double yStart, double yEnd) ...@@ -91,10 +92,9 @@ void Zooming::move(double xStart, double xEnd, double yStart, double yEnd)
int lbloknum = cblk[1].m_bloknum; int lbloknum = cblk[1].m_bloknum;
// Get first block size in col from x to xEnd // Get first block size in col from x to xEnd
int x = (cblk->m_fcolnum - startCol) * xCoeff; int x = (cblk->m_fcolnum - startCol) * xCoeff;
int xEnd = (cblk->m_lcolnum - startCol) * xCoeff; int xEnd = (cblk->m_lcolnum + 1 - startCol) * xCoeff;
xEnd = ( xEnd > x+1 ) ? xEnd : x+1;
float cblk_color = cblk->m_color; float cblk_color = cblk->m_color;
blok = m_matrix->m_bloktab + fbloknum; blok = m_matrix->m_bloktab + fbloknum;
...@@ -106,19 +106,17 @@ void Zooming::move(double xStart, double xEnd, double yStart, double yEnd) ...@@ -106,19 +106,17 @@ void Zooming::move(double xStart, double xEnd, double yStart, double yEnd)
continue; continue;
} }
// Get first block size in row from y to yEnd // Get first block size in row from y to yEnd
int y = (blok->m_frownum - startRow) * yCoeff; int y = (blok->m_frownum - startRow) * yCoeff;
int yEnd = (blok->m_lrownum - startRow) * yCoeff; int yEnd = (blok->m_lrownum + 1 - startRow) * yCoeff;
yEnd = ( yEnd > y+1 ) ? yEnd : y+1;
float color = blok->m_color == -1. ? cblk_color : blok->m_color; float color = blok->m_color == -1. ? cblk_color : blok->m_color;
for( m=x; m<xEnd; m++ ) for( m=x; m<xEnd; m++ )
{ {
for( n=y; n<yEnd; n++ ) for( n=y; n<yEnd; n++ )
{ {
m_colors[m][n] = color; m_colors[m][n] = color;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment