mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-03 14:35:03 -04:00
Test of draggable scope area + fixes
- Will be able to drag back/forth to cycle scope/spectrum/plot - Fix for two crashes
This commit is contained in:
@@ -8,6 +8,9 @@ using namespace CubicVR;
|
||||
GLPanel::GLPanel() : fillType(GLPANEL_FILL_SOLID), contentsVisible(true), transform(mat4::identity()) {
|
||||
pos[0] = 0.0f;
|
||||
pos[1] = 0.0f;
|
||||
rot[0] = 0.0f;
|
||||
rot[1] = 0.0f;
|
||||
rot[2] = 0.0f;
|
||||
size[0] = 1.0f;
|
||||
size[1] = 1.0f;
|
||||
fill[0] = RGBA4f(0.5,0.5,0.5);
|
||||
@@ -241,6 +244,11 @@ void GLPanel::drawPanelContents() {
|
||||
void GLPanel::calcTransform(mat4 transform_in) {
|
||||
// compute local transform
|
||||
localTransform = mat4::translate(pos[0], pos[1], 0) * mat4::scale(size[0], size[1], 1);
|
||||
|
||||
if (rot[0] || rot[1] || rot[2]) {
|
||||
localTransform *= mat4::rotate(rot[0], rot[1], rot[2]);
|
||||
}
|
||||
|
||||
// compute global transform
|
||||
transform = transform_in * localTransform;
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ public:
|
||||
typedef enum GLPanelFillType { GLPANEL_FILL_NONE, GLPANEL_FILL_SOLID, GLPANEL_FILL_GRAD_X, GLPANEL_FILL_GRAD_Y, GLPANEL_FILL_GRAD_BAR_X, GLPANEL_FILL_GRAD_BAR_Y } GLPanelFillType;
|
||||
typedef enum GLPanelCoordinateSystem { GLPANEL_Y_DOWN_ZERO_ONE, GLPANEL_Y_UP_ZERO_ONE, GLPANEL_Y_UP, GLPANEL_Y_DOWN } GLPanelCoordinateSystem;
|
||||
float pos[2];
|
||||
float rot[3];
|
||||
float size[2];
|
||||
float view[2];
|
||||
GLPanelFillType fillType;
|
||||
|
||||
Reference in New Issue
Block a user