61 lines
2.2 KiB
Diff
61 lines
2.2 KiB
Diff
Index: src/pixel.cpp
|
|
===================================================================
|
|
--- src/pixel.cpp (revision 908)
|
|
+++ src/pixel.cpp (revision 910)
|
|
@@ -171,6 +171,7 @@
|
|
//-----------------------------------------------------------------------------
|
|
mglPoint mglCanvas::CalcXYZ(int xs, int ys, bool real) const
|
|
{
|
|
+ if(xs<0 || ys<0 || xs>=Width || ys>=Height) return mglPoint(NAN,NAN,NAN);
|
|
mglPoint p, ps(xs,Height-ys,NAN);
|
|
float zz = Z[3*(xs+Width*(Height-1-ys))];
|
|
if(zz>-1e20f) { ps.z = zz; real=false; }
|
|
Index: src/base.cpp
|
|
===================================================================
|
|
--- src/base.cpp (revision 908)
|
|
+++ src/base.cpp (revision 910)
|
|
@@ -236,7 +236,7 @@
|
|
// scl&4 -- ???
|
|
// scl&8 -- bypass palette for enabling alpha
|
|
if(mgl_isnan(c) || mgl_isnan(a)) return -1;
|
|
- bool norefr = mgl_isnan(n.x) && mgl_isnan(n.y);
|
|
+ bool norefr = mgl_isnan(n.x) && mgl_isnan(n.y) && !mgl_isnan(n.z);
|
|
if(scl>0) ScalePoint(mat,p,n,!(scl&2));
|
|
if(mgl_isnan(p.x)) return -1;
|
|
a = (a>=0 && a<=1) ? a : AlphaDef;
|
|
Index: src/canvas.cpp
|
|
===================================================================
|
|
--- src/canvas.cpp (revision 908)
|
|
+++ src/canvas.cpp (revision 910)
|
|
@@ -786,7 +786,7 @@
|
|
x += B.x-iw/2+dx; y += B.y-ih/2+dy;
|
|
// draw it
|
|
long k1=0,k2=0,k3=0,k4=0;
|
|
- mglPoint p,q=mglPoint(NAN);
|
|
+ mglPoint p,q=mglPoint(NAN,NAN,NAN);
|
|
|
|
for(i=0;ff[i] && ff[i]!=':';i++) if(strchr(MGL_COLORS,ff[i]))
|
|
{
|
|
@@ -937,7 +937,7 @@
|
|
char col = mglGetStyle(stl,0,&align); align = align&3;
|
|
if(col==0) col = 'k';
|
|
mreal y=inY+inH-h;
|
|
- mglPoint p(inX + inW*align/2.,y,3*Depth),q(NAN);
|
|
+ mglPoint p(inX + inW*align/2.,y,3*Depth),q(NAN,NAN,NAN);
|
|
mglMatrix M=B; M.norot=true;
|
|
if(title) text_plot(AddPnt(&M,p,-1,q,-1,0),title,stl,size);
|
|
if(box) // draw boungind box
|
|
Index: examples/full_test.cpp
|
|
===================================================================
|
|
--- examples/full_test.cpp (revision 908)
|
|
+++ examples/full_test.cpp (revision 910)
|
|
@@ -71,7 +71,7 @@
|
|
{
|
|
mglParse par;
|
|
setlocale(LC_CTYPE, "");
|
|
- par.Execute(gr,"box\r\n\r\naxis");
|
|
+ par.Execute(gr,"light on:addlegend 'r' 'r':legend");
|
|
}
|
|
//-----------------------------------------------------------------------------
|
|
#if !defined(_MSC_VER) && !defined(__BORLANDC__)
|