Snapshot fixes and improvements.
* Allow to pass -1 to LLImageBase::reallocateData too (default parameter), causing it to allocate what is necessary for the size set (same behavior as allocateData). * Speed up LLImageRaw::scale with factor 2 or 3 by copying the data less often and calling LLImageBase::reallocateData instead of destroying and recreating always. * Fix gl_rect_2d to not decrement top and right with one pixel. * Remove the vague "Constrain Proportions" checkbox and replace it with a new combo box and spinner to explicitly set the target aspect ratio, allowing to set it also to something different than either the window aspect ratio (ie, 1.6) or the target image dimension (1.0 for textures) which was totally lacking when, for example, uploading a profile image (which needs to be 4:3). This also allows to show snapshots on prims of arbitrary aspects.
This commit is contained in:
@@ -201,15 +201,13 @@ void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled )
|
||||
gGL.begin( LLRender::LINES );
|
||||
|
||||
// Verticals
|
||||
gGL.vertex2i(left + 1, top);
|
||||
gGL.vertex2i(left + 1, bottom);
|
||||
gGL.vertex2i(left + 1, top + 1);
|
||||
gGL.vertex2i(left + 1, bottom + 1);
|
||||
|
||||
gGL.vertex2i(right, bottom);
|
||||
gGL.vertex2i(right, top);
|
||||
gGL.vertex2i(right + 1, bottom + 1);
|
||||
gGL.vertex2i(right + 1, top + 1);
|
||||
|
||||
// Horizontals
|
||||
top--;
|
||||
right--;
|
||||
gGL.vertex2i(left, bottom);
|
||||
gGL.vertex2i(right, bottom);
|
||||
|
||||
@@ -219,8 +217,6 @@ void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled )
|
||||
}
|
||||
else
|
||||
{
|
||||
top--;
|
||||
right--;
|
||||
gGL.begin( LLRender::LINE_STRIP );
|
||||
gGL.vertex2i(left, top);
|
||||
gGL.vertex2i(left, bottom);
|
||||
|
||||
Reference in New Issue
Block a user