Skip to content

Commit

Permalink
exp: use logarithmic scale for polygon offset sliders
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Dec 22, 2024
1 parent f4fd75e commit b8c7eff
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Misc/qs_pak/scripts/expmode_engine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ local imText <const> = ImGui.Text
local imVec2 <const> = vec2.new

local imKey <const> = ImGui.Key
local imSliderFlags <const> = ImGui.SliderFlags
local imTableFlags <const> = ImGui.TableFlags

local imAlwaysClamp <const> = ImGui.SliderFlags.AlwaysClamp
local imAlwaysClamp <const> = imSliderFlags.AlwaysClamp
local imLogarithmic <const> = imAlwaysClamp | imSliderFlags.Logarithmic
local imLeftArrow <const> = imKey.LeftArrow
local imRightArrow <const> = imKey.RightArrow
local imTableColumnWidthFixed <const> = ImGui.TableColumnFlags.WidthFixed
Expand Down Expand Up @@ -543,14 +545,14 @@ expmode.addaction(function ()
local changed, value

value = PolyOffsetFactor()
changed, value = imSliderFloat('Factor', value, -16, 16, imAlwaysClamp)
changed, value = imSliderFloat('Factor', value, -16, 16, imLogarithmic)

if changed then
PolyOffsetFactor(value)
end

value = PolyOffsetUnits()
changed, value = imSliderFloat('Units', value, -16, 16, imAlwaysClamp)
changed, value = imSliderFloat('Units', value, -16, 16, imLogarithmic)

if changed then
PolyOffsetUnits(value)
Expand Down

0 comments on commit b8c7eff

Please sign in to comment.