Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/BasicSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ function BasicSettings({ hidden, role, store }) {
label={t("guideangle")}
type="number"
value={store.guideline.angle}
disabled={store.ratio !== "custom"}
onChange={(e) => store.setGuidelineAngle(e.target.value)}
Copy link
Owner Author

Choose a reason for hiding this comment

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

This suggestion is also already handled by the store implementation!

Looking at the store code (SHA 1074b77), store.setGuidelineAngle() already automatically switches to "custom" when called:

setGuidelineAngle(angle) {
  this.guideline.angle = Math.min(Math.max(angle, 15), 90);
  if (this.ratio !== "custom") this.setRatioPreset("custom");
}

The current implementation onChange={(e) => store.setGuidelineAngle(e.target.value)} is correct and complete. The store method handles both updating the angle value AND switching to custom preset automatically.

slotProps={{
input: {
Expand Down
1 change: 0 additions & 1 deletion src/RatiosInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ function RatiosInput({ store }) {
<Input
type="number"
value={r}
disabled={store.ratio !== "custom"}
onChange={(e) => store.setRatio(i, e.target.value)}
Copy link
Owner Author

Choose a reason for hiding this comment

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

This suggestion is already handled by the store implementation!

Looking at the store code (SHA 1074b77), store.setRatio() already automatically switches to "custom" when called:

setRatio(index, value) {
  this.ratios[index] = Math.min(Math.max(value, 0), 20);
  if (this.ratio !== "custom") this.setRatioPreset("custom");
}

So the current implementation onChange={(e) => store.setRatio(i, e.target.value)} is correct and doesn't need the additional setPreset('custom') call.

style={{ marginTop: 16, width: 60 }}
/>
Expand Down