TrickyWidget 0 Posted March 24, 2021 (edited) Hi, folks. I'm returning to Delphi after a looooong time away. I just cranked up 10.3 (26.0.36039.7899) on Windows 10 and mostly it seems fine. However, when I size my widgets with the snap grid on the form, they're always 1 too big on both axes. For example, if I set the grid to 16x16 and make a button that is 2 spaces x 2 spaces, its size should be 32x32. But instead, it's 33x33. Or if I make it 6x3 spaces, its size is 97x49. I've poked and tweaked everything I can think of, but they refuse to budge. Every widget on every form is 1 too big! Does anyone know what's going on or how to fix it? Thanks! EDIT: This is about using the form designer in the IDE. Here's an example with a 32x32 form snap grid. All four corners of this button have been "snapped" to the grid. It is 3 grid spaces wide and 2 grid spaces tall. Its size should be 96x64. But instead, it is 97x65. Edited March 24, 2021 by TrickyWidget Share this post Link to post
Guest Posted March 24, 2021 hi @TrickyWidget I dont know how you did your grid without see your code, but for easy adjustment for each content you can use a "GridPanel" and put your "containers" (...any other components like a Panel, Button, Edit, etc...") onto it. Then, you can use the properties, like: AlignWithMargins, Margins and Padding for accomodate it automatocally without any code. You see? hug Share this post Link to post
TrickyWidget 0 Posted March 24, 2021 No code, just the snap-to grid that's on by default on each form. The spacing is set in Tools > Options > Form Designer > Grid Options > Grid size/Snap tolerance. Share this post Link to post
Guest Posted March 24, 2021 (edited) hi @TrickyWidget I dont remember have used some like this... can you give a script to reproduce it? im curious about this... would be some like this representation ? (blue lines) or hug Edited March 24, 2021 by Guest Share this post Link to post
TrickyWidget 0 Posted March 24, 2021 Again, there's no script involved. This is only using the IDE form designer. Just make a new form and drop a button on it. Then use the snap-grid to resize the button (or any other visible control) and check the size. The control size should be an even multiple of the snap grid size. But mine are always that +1. Share this post Link to post
Guest Posted March 24, 2021 (edited) I think that understood now... but look that the value stay on 2 and 128... not exist "1" look below size-value of Button2 is = 1 + 2 = 3 hug Edited March 24, 2021 by Guest Share this post Link to post
TrickyWidget 0 Posted March 24, 2021 (edited) Just this. I made the "Grid size/Snap tolerance" 32x32 so it's easy to see. All four corners of this button have been "snapped" to the grid. It is 3 grid spaces wide and 2 grid spaces tall. Its size should be 96x64. But instead, it is 97x65. Edited March 24, 2021 by TrickyWidget Share this post Link to post
Guest Posted March 24, 2021 (edited) 1 should be because it's a "minimun size to a graphical element" on the screen... 1 (border visible in both side of component on screen - there is not "1/2 component" you see?) + 96 = 97. hug Edited March 24, 2021 by Guest Share this post Link to post