[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #42435] cropped image elements don't display
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #42435] cropped image elements don't display |
Date: |
Mon, 21 Nov 2016 19:56:15 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 |
Follow-up Comment #2, bug #42435 (project octave):
This is a known issue. The code in gl-render.cc for draw_image has the
following:
// OpenGL won't draw any of the image if its origin is outside the
// viewport/clipping plane so we must do the clipping ourselves.
int j0, j1, i0, i1;
j0 = 0, j1 = w;
i0 = 0, i1 = h;
float im_xmin = x(0) - nor_dx/2;
float im_xmax = x(1) + nor_dx/2;
float im_ymin = y(0) - nor_dy/2;
float im_ymax = y(1) + nor_dy/2;
if (props.is_clipping ()) // clip to axes
{
if (im_xmin < xmin)
j0 += (xmin - im_xmin)/nor_dx + 1;
if (im_xmax > xmax)
j1 -= (im_xmax - xmax)/nor_dx;
if (im_ymin < ymin)
i0 += (ymin - im_ymin)/nor_dy + 1;
if (im_ymax > ymax)
i1 -= (im_ymax - ymax)/nor_dy;
}
else // clip to viewport
{
GLfloat vp[4];
glGetFloatv (GL_VIEWPORT, vp);
// FIXME: actually add the code to do it!
}
Any change would have to start here.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?42435>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/