mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
fix nan in scissor region
This commit is contained in:
parent
6e72268787
commit
9a817b27c6
@ -4258,7 +4258,13 @@ set_scissor(float left, float right, float bottom, float top) {
|
||||
float ysize = top - bottom;
|
||||
float xcenter = (left + right) - 1.0f;
|
||||
float ycenter = (bottom + top) - 1.0f;
|
||||
if (xsize == 0.0f || ysize == 0.0f) {
|
||||
// If the scissor region is zero, nothing will be drawn anyway, so
|
||||
// don't worry about it.
|
||||
_scissor_mat = TransformState::make_identity();
|
||||
} else {
|
||||
_scissor_mat = TransformState::make_scale(LVecBase3f(1.0f / xsize, 1.0f / ysize, 1.0f))->compose(TransformState::make_pos(LPoint3f(-xcenter, -ycenter, 0.0f)));
|
||||
}
|
||||
prepare_lens();
|
||||
}
|
||||
|
||||
|
@ -1958,7 +1958,13 @@ set_scissor(float left, float right, float bottom, float top) {
|
||||
float ysize = top - bottom;
|
||||
float xcenter = (left + right) - 1.0f;
|
||||
float ycenter = (bottom + top) - 1.0f;
|
||||
if (xsize == 0.0f || ysize == 0.0f) {
|
||||
// If the scissor region is zero, nothing will be drawn anyway, so
|
||||
// don't worry about it.
|
||||
_scissor_mat = TransformState::make_identity();
|
||||
} else {
|
||||
_scissor_mat = TransformState::make_scale(LVecBase3f(1.0f / xsize, 1.0f / ysize, 1.0f))->compose(TransformState::make_pos(LPoint3f(-xcenter, -ycenter, 0.0f)));
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "config_tinydisplay.h"
|
||||
#include "config_windisplay.h"
|
||||
#include "tinyWinGraphicsWindow.h"
|
||||
#include "tinyGraphicsBuffer.h"
|
||||
|
||||
TypeHandle TinyWinGraphicsPipe::_type_handle;
|
||||
|
||||
@ -116,6 +117,15 @@ make_output(const string &name,
|
||||
flags, gsg, host);
|
||||
}
|
||||
|
||||
// Second thing to try: a TinyGraphicsBuffer
|
||||
if (retry == 1) {
|
||||
if (((flags&BF_require_parasite)!=0)||
|
||||
((flags&BF_require_window)!=0)) {
|
||||
return NULL;
|
||||
}
|
||||
return new TinyGraphicsBuffer(this, name, fb_prop, win_prop, flags, gsg, host);
|
||||
}
|
||||
|
||||
// Nothing else left to try.
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user