mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 13:48:38 -05:00
margin tweaks
This commit is contained in:
parent
c770a0e20e
commit
8ccb060237
@ -264,8 +264,8 @@ void GLPanel::draw(CubicVR::mat4 transform_in, GLPanel *parent) {
|
||||
std::cout << umin << " :: " << ucenter << " :: " << pdim << " :: " << pvec << std::endl;
|
||||
|
||||
if (marginPx.left || marginPx.right || marginPx.top || marginPx.bottom) {
|
||||
localTransform *= mat4::translate(marginPx.left*pvec.x, marginPx.top*pvec.y, 0) *
|
||||
mat4::scale(1.0-(marginPx.left+marginPx.right)*pvec.x, 1.0-(marginPx.top+marginPx.bottom)*pvec.y, 0);
|
||||
localTransform *= mat4::translate(marginPx.left*pvec.x/size[0], marginPx.top*pvec.y/size[1], 0) *
|
||||
mat4::scale(1.0-(marginPx.left+marginPx.right)*pvec.x/size[0], 1.0-(marginPx.top+marginPx.bottom)*pvec.y/size[1], 0);
|
||||
transform = transform_in * localTransform;
|
||||
}
|
||||
|
||||
|
@ -12,19 +12,19 @@ PrimaryGLContext(canvas, sharedContext) {
|
||||
testPanel.setFillColor(RGB(0.0,0.0,1.0), RGB(0.0,1.0,0.0));
|
||||
|
||||
testChildPanel.setPosition(0.0, 0.0);
|
||||
testChildPanel.setMarginPx(10);
|
||||
testChildPanel.setSize(1.0, 0.3);
|
||||
testChildPanel.setMarginPx(10,10,10,5);
|
||||
testChildPanel.setSize(1.0, 0.5);
|
||||
testChildPanel.setFill(GLPanel::GLPANEL_FILL_GRAD_BAR_X);
|
||||
testChildPanel.setFillColor(RGB(0.0,0.0,1.0), RGB(0.0,1.0,0.0));
|
||||
testChildPanel.setBorderPx(1);
|
||||
|
||||
testChildPanel2.setPosition(0.0, 0.3);
|
||||
testChildPanel2.setSize(1.0, 0.3);
|
||||
testChildPanel2.setMarginPx(10);
|
||||
testChildPanel2.setPosition(0.0, 0.5);
|
||||
testChildPanel2.setSize(1.0, 0.5);
|
||||
testChildPanel2.setMarginPx(10,10,5,10);
|
||||
testChildPanel2.setFill(GLPanel::GLPANEL_FILL_GRAD_X);
|
||||
testChildPanel2.setFillColor(RGB(0.0,0.0,1.0), RGB(0.0,1.0,0.0));
|
||||
testChildPanel2.setBorderColor(RGB(1.0,0.0,0.0));
|
||||
testChildPanel2.setBorderPx(2,4,6,8);
|
||||
testChildPanel2.setBorderPx(1);
|
||||
|
||||
testPanel.addChild(&testChildPanel);
|
||||
testPanel.addChild(&testChildPanel2);
|
||||
|
Loading…
Reference in New Issue
Block a user