Commit 908b9b39 authored by Frédéric Larue's avatar Frédéric Larue
Browse files

Bug fix in the SelectionManagerImageTexels::getSelectionMask() function.

parent c43ad4fd
......@@ -199,14 +199,14 @@ bool SelectionManagerImageTexels::getSelectionMask( std::vector<uint8_t> &mask )
{
t->tex.DumpTo( selectionBuffer, GL_RED, GL_UNSIGNED_BYTE );
for( int i=t->y, n=0; i<t->y+t->h; ++i )
for( int i=t->y+t->h-1, n=0; i>=t->y; --i )
for( int j=t->x; j<t->x+t->w; ++j, ++n )
mask[ i*m_ImageWidth + j ] = selectionBuffer[n];
}
else
{
for( int i=t->y, n=0; i<t->y+t->h; ++i )
for( int j=t->x; j<t->x+t->w; ++j, ++n )
for( int i=t->y; i<t->y+t->h; ++i )
for( int j=t->x; j<t->x+t->w; ++j )
mask[ i*m_ImageWidth + j ] = 0;
}
......
Supports Markdown
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