Skip to content

Commit

Permalink
Fix unintuitive illustraton of follow combo color setting for slider …
Browse files Browse the repository at this point in the history
…body
  • Loading branch information
Rian8337 committed Mar 21, 2024
1 parent 783eba6 commit 5260de1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ export default function SliderIllustrationCanvas() {
ctx.stroke();

ctx.globalAlpha = sliderBodyBaseAlpha.value;
ctx.strokeStyle = sliderBodyColor.value;
ctx.strokeStyle = sliderFollowComboColor.value
? sliderComboColor.value
: sliderBodyColor.value;

ctx.stroke();
ctx.globalCompositeOperation = "source-over";
Expand All @@ -127,9 +129,7 @@ export default function SliderIllustrationCanvas() {
ctx.closePath();

// Draw the slider head.
ctx.fillStyle = sliderFollowComboColor.value
? sliderBodyColor.value
: sliderComboColor.value;
ctx.fillStyle = sliderComboColor.value;
ctx.globalAlpha = 1;

ctx.beginPath();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
import { useContext } from "react";
import { SliderFollowComboColorContext } from "../../../../hooks/Slider/SliderFollowComboColorContext";
import SubGroup from "../../SubGroup";
import SliderIllustrationCanvas from "./SliderIllustrationCanvas";
import SliderIllustrationCircleSize from "./SliderIllustrationCircleSize";
import SliderIllustrationComboColor from "./SliderIllustrationComboColor";

export default function SliderIllustrationGroup() {
const followComboColor = useContext(SliderFollowComboColorContext);

return (
<SubGroup title="Illustration">
<br />
<SliderIllustrationCanvas />

<SliderIllustrationCircleSize />

{!followComboColor.value ? <SliderIllustrationComboColor /> : null}
<SliderIllustrationComboColor />
</SubGroup>
);
}

0 comments on commit 5260de1

Please sign in to comment.