Skip to content

Commit

Permalink
fix GUIPanel slider bugs and generate gui button clipping
Browse files Browse the repository at this point in the history
  • Loading branch information
terry083000 committed Apr 21, 2024
1 parent 32fd3cd commit 1d7930d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ node_modules
.idea
.yarn
.pnp.*
.idx
yarn.lock
dist
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
<button id="HIDTab" type="button" class="header-item">HID</button>
</div>
<div id="GUIContainer" class="dark:bg-dark-2 w-full h-full">
<div id="GUIPanel" class="w-full h-full relative">
<div id="GUIPanel" class="w-full h-full relative overflow-hidden">
</div>
</div>
<div id="HIDContainer" class="relative dark:bg-dark-2 w-full h-full overflow-auto md:overflow-hidden">
Expand Down
5 changes: 2 additions & 3 deletions src/components/gui/gui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const GUIPanel = document.getElementById("GUIPanel") as HTMLDivElement;

// Constants
const RATIO = window.devicePixelRatio || 1;
console.log("window scale ratio:", RATIO);
// console.log("window scale ratio:", RATIO);
const BUTTON_MARGIN = 10 * RATIO;
const BUTTON_SIZE = 70 * RATIO;
const SLIDER_MARGIN = 15 * RATIO;
Expand Down Expand Up @@ -130,7 +130,7 @@ export default class GUI {
globals.float[i],
GUI.ctx,
GUI.isDark,
sliderValues ? sliderValues[i] : 0
sliderValues != undefined ? sliderValues[i] : 0
);
GUI.sliders.push(floatSlider);
}
Expand Down Expand Up @@ -253,7 +253,6 @@ export default class GUI {
GUI.resizeDimensions();
GUI.generateGUI(sliderValues);

GUI.sliders.forEach((slider, i) => (slider.value = sliderValues[i]));
GUI.draw();
}

Expand Down

0 comments on commit 1d7930d

Please sign in to comment.