Skip to content

Commit 4e3fae5

Browse files
committed
Fixes button disabled when going backward
1 parent 281cd43 commit 4e3fae5

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.28)
55

66
set(wgpu-shader-toy_RELEASE_YEAR "2025")
77
set(wgpu-shader-toy_RELEASE_MONTH "02" )
8-
set(wgpu-shader-toy_RELEASE_DAY "26" )
8+
set(wgpu-shader-toy_RELEASE_DAY "27" )
99

1010
set(wgpu-shader-toy_VERSION "${wgpu-shader-toy_RELEASE_YEAR}.${wgpu-shader-toy_RELEASE_MONTH}.${wgpu-shader-toy_RELEASE_DAY}")
1111

src/cpp/FragmentShader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ struct ShaderToyInputs {
102102
void resetTime();
103103
void startManualClock() { fClock.setManual(true); }
104104
void endManualClock() { fClock.setManual(false); }
105+
constexpr bool isManualClock() const { return fClock.isManual(); }
105106

106107
constexpr bool isEnabled() const { return fEnabled; }
107108
constexpr void toggleEnabled() { fEnabled = !fEnabled; }

src/cpp/MainWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ void MainWindow::renderTimeControls()
452452
auto const frameCount = isKeyAlt ? 1 : 12;
453453

454454
// Previous frame
455-
ImGui::BeginDisabled(fCurrentFragmentShader->getInputs().frame == 0);
455+
ImGui::BeginDisabled(fCurrentFragmentShader->getInputs().frame == 0 && !fCurrentFragmentShader->isManualClock());
456456
{
457457
static bool kClockState{};
458458
ImGui::PushItemFlag(ImGuiItemFlags_ButtonRepeat, true);

src/cpp/utils/Clock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class Clock
4949
void resume() { fPaused = false; }
5050

5151
void setManual(bool iManual) { fManual = iManual; }
52+
constexpr bool isManual() const { return fManual; }
5253

5354
void reset()
5455
{

0 commit comments

Comments
 (0)