Jump to content
Sign in to follow this  
Sniperwolf572

RscControlsGroup - Incorrect content height calculation

Recommended Posts

Does anyone have any idea why the controls within RscControlsGroup seem to vertically overflow the RscControlsGroup causing it to become scrollable the more you move a control away from the 0,0 point vertically?

To explain better, it's as if the vertical offset above the control is also added to the bottom of the control, causing the control group to act as if the occupied space within it is: vertical offset + control height + vertical offset

To illustrate:

nFj3f4Ds.jpg QYvx55Gs.jpg

I've reduced the code for my dialog to the bare minimum to reproduce this, and it looks like this:

#include "ui_defines.hpp"
#include "ui_parents.hpp"

class TestDialog {

idd = -1;
movingEnable = 0;
enableSimulation = 1;
objects[] = {};

// Background Controls
class ControlsBackground {};

// Foreground Controls
class Controls {

	class TEN_Controls : RscControlsGroup {
		idc = -1;

		x = 36.5 * GUI_GRID_W + GUI_GRID_X;
		y = 13 * GUI_GRID_H + GUI_GRID_Y;
		w = 32 * GUI_GRID_W;
		h = 22.5 * GUI_GRID_H;

		class Controls {

			class TEN_Deploy : RscButton {
				idc = -1;
				text = "Prepare";
				x = 0.5 * GUI_GRID_W;
				y = 19.5 * GUI_GRID_H;
				w = 31 * GUI_GRID_W;
				h = 2.5 * GUI_GRID_H;
			};

		};

	};

};

};

I'm aware that I can prevent scrolling and hide the scrollbars, but this removes the flexibility of the control group to automatically become scrollable if/when it overflows.

What am I doing wrong here? Or is it an inherent issue/bug with the ControlsGroup type?

Share this post


Link to post
Share on other sites

You're right, it seems as if the group wants its controls to be vertically centered. I reported it internally, thanks for repro ;)

Share this post


Link to post
Share on other sites
You're right, it seems as if the group wants its controls to be vertically centered. I reported it internally, thanks for repro ;)

You're welcome. Thanks for confirming that it's a bug. :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×