Skip to content

Commit

Permalink
Merge pull request #13724 from carolhmj/GUIFixIdealWidthHeightCalcs
Browse files Browse the repository at this point in the history
Round up ideal width/height calculations so no control is cut off
  • Loading branch information
sebavan committed Apr 11, 2023
2 parents aa22ae4 + 8b5a68a commit 828ee43
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,22 @@
// "envFile": "${workspaceRoot}/.env",
"preLaunchTask": "CDN Serve (Dev)"
},
{
/*
Launch tests
https://jestjs.io/docs/troubleshooting#debugging-in-vs-code
*/
"type": "node",
"request": "launch",
"name": "Update single validation test - WebGL2 (Dev)",
"runtimeArgs": ["--inspect-brk", "${workspaceRoot}/node_modules/jest/bin/jest.js", "--runInBand", "--selectProjects", "visualization", "-i", "webgl2", "-t", "${input:testName}" , "-u"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229,
// "outFiles": ["${workspaceRoot}/**/dist/**/*"], // debugging sources
// "envFile": "${workspaceRoot}/.env",
"preLaunchTask": "CDN Serve (Dev)"
},
{
/*
Launch tests
Expand Down
4 changes: 2 additions & 2 deletions packages/dev/gui/src/2D/valueAndUnit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ export class ValueAndUnit {
let height: number = 0;

if (host.idealWidth) {
width = (this._value * host.getSize().width) / host.idealWidth;
width = Math.ceil((this._value * host.getSize().width) / host.idealWidth);
}

if (host.idealHeight) {
height = (this._value * host.getSize().height) / host.idealHeight;
height = Math.ceil((this._value * host.getSize().height) / host.idealHeight);
}

if (host.useSmallestIdeal && host.idealWidth && host.idealHeight) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/tools/tests/test/visualization/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,10 @@
"title": "Sprites Pixel Perfect",
"playgroundId": "#ZX8DJ3#10",
"excludedEngines": ["webgl1"]
},
{
"title": "Rounding values on controls inside StackPanel",
"playgroundId": "#XCPP9Y#18325"
}
]
}

0 comments on commit 828ee43

Please sign in to comment.