Skip to content

Commit

Permalink
Fixed brush relative size, using canvas size instead of magic number
Browse files Browse the repository at this point in the history
  • Loading branch information
Nrosa01 committed May 10, 2024
1 parent a75eed4 commit e2dfe0b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/BrushSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import slider from "../assets/sounds/hover.wav";
const { play: playSlider } = useSound(slider, { volume: 0.5, interrupt: false });
const value = ref(25);
let canvas = document.getElementById("glcanvas");
const brush_size = computed(() => {
let diagonal = 800 * Math.sqrt(2);
let diagonal = canvas.width * Math.sqrt(2);
let maxRadius = diagonal / 2;
let fraction = value.value / 100;
let radius = Math.pow(fraction, 2) * maxRadius;
Expand Down

0 comments on commit e2dfe0b

Please sign in to comment.