Skip to content

Commit

Permalink
Increased snap point granularity. Fixed weird snap points for spin sl…
Browse files Browse the repository at this point in the history
…iders.
  • Loading branch information
ReFreezed committed Jun 8, 2020
1 parent 06d2aad commit cddceb2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/gui.gloa
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export Slider :: struct {
min = 0.0,
max = 1.0,

steps = 16,
steps = 32,

limitName = "",
limitCenter = 0.0,
Expand Down
6 changes: 3 additions & 3 deletions src/guiSetup.gloa
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ export setupGuiFrames :: () {
guiState.separator!({ thick=false }),

guiState.section!({ name="spinSection", label="Spin", icon16="spin",
guiState.slider!({ name="spinMin", labelLeft="at start", min=-8*math.TAU, max=8*math.TAU, exponential=true, limitName="spin", readoutMulti=1/math.TAU, readout="%.2f turns / sec", linkMultiDrag={"spinMax"} }),
guiState.slider!({ name="spinMax", labelLeft="at end", min=-8*math.TAU, max=8*math.TAU, exponential=true, limitName="spin", readoutMulti=1/math.TAU, readout="%.2f turns / sec", linkMultiDrag={"spinMin"} }),
guiState.slider!({ name="spinVariation", labelLeft="variation", min=0, max=1, readoutMulti=100, readout="%d%%" }),
guiState.slider!({ name="spinMin", labelLeft="at start", min=-8, max=8, exponential=true, limitName="spin", readout="%.2f turns / sec", linkMultiDrag={"spinMax"} }),
guiState.slider!({ name="spinMax", labelLeft="at end", min=-8, max=8, exponential=true, limitName="spin", readout="%.2f turns / sec", linkMultiDrag={"spinMin"} }),
guiState.slider!({ name="spinVariation", labelLeft="variation", min=0, max=1, readoutMulti=100, readout="%d%%" }),
}),

guiState.separator!({ thick=true }),
Expand Down
6 changes: 3 additions & 3 deletions src/main.gloa
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ export System :: struct {
psSizeVariation = 0.0,
psSpeedMin = 0.0,
psSpeedMax = 0.0,
psSpinMin = 0.0,
psSpinMax = 0.0,
psSpinMin = 0.0, -- Turns, not angle.
psSpinMax = 0.0, -- Turns, not angle.
psSpinVariation = 0.0,
psSpread = 0.0,
psTangentialAccelerationMin = 0.0,
Expand Down Expand Up @@ -500,7 +500,7 @@ export updateParticleParams :: (project:Project, s:System) {
ps.setSizes!(sizes)
ps.setSizeVariation!(s.psSizeVariation)
ps.setSpeed!(s.psSpeedMin*space*time, s.psSpeedMax*space*time)
ps.setSpin!(s.psSpinMin*time, s.psSpinMax*time)
ps.setSpin!(s.psSpinMin*time*math.TAU, s.psSpinMax*time*math.TAU)
ps.setSpinVariation!(s.psSpinVariation)
ps.setSpread!(s.psSpread)
ps.setTangentialAcceleration!(s.psTangentialAccelerationMin*space*time^2, s.psTangentialAccelerationMax*space*time^2)
Expand Down
4 changes: 3 additions & 1 deletion src/workspace.gloa
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
--============================================================]]

local LAST_FILE_VERSION :: 5
local LAST_FILE_VERSION :: 6



Expand Down Expand Up @@ -814,6 +814,8 @@ export loadWorkspace :: (path:string) -> (success:bool, gotError:bool, app:App)
local ^ok, ^ptr, min = readFloat(version, line, cast(int)ptr) ; if not ok return parsingError(path, ln, "Bad value format: %s", line)
local ^ok, ^ptr, max = readFloat(version, line, cast(int)ptr) ; if not ok return parsingError(path, ln, "Bad value format: %s", line)
if cast(int)ptr <= #line return parsingError(path, ln, "Garbage after values: %s", line)
if version < 6 min /= math.TAU
if version < 6 max /= math.TAU
system.psSpinMin = min
system.psSpinMax = max

Expand Down

0 comments on commit cddceb2

Please sign in to comment.