Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Fix slider size in CreateSlider function #19

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Space-Traveling
Copy link

image

Solves sliders spawning at the incorrect size when set to 100%.

Any slider set to 100% will spawn in oversized. This patches that bug.

local sliderSize = (End_Pixels - Start_Pixels) --Full bar size in px
Copy link

@Zer0ids Zer0ids Feb 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't you just put Slider.Main.AbsoluteSize.X? Because you're subtracting the End_Pixels's AbsolutePosition.X by Start_Pixels, which makes it zero.

So, can you just do this instead?:

local sliderSize = Slider.Main.AbsoluteSize.X * ((SliderSettings.CurrentValue + SliderSettings.Range[1]) / (SliderSettings.Range[2] - SliderSettings.Range[1]))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants