Push
This commit is contained in:
+10
-2
@@ -157,6 +157,14 @@ export default function App() {
|
|||||||
let mouseX = e.pageX
|
let mouseX = e.pageX
|
||||||
let mouseY = e.pageY
|
let mouseY = e.pageY
|
||||||
|
|
||||||
|
if (selectedTool === "pencil" || selectedTool === "eraser") {
|
||||||
|
hintContext.clearRect(0, 0, 5000, 3000)
|
||||||
|
hintContext.beginPath()
|
||||||
|
hintContext.fillStyle = colorValue
|
||||||
|
hintContext.arc(mouseX, mouseY, strokeWidthSliderValue, 0, 2 * Math.PI, false)
|
||||||
|
hintContext.fill()
|
||||||
|
}
|
||||||
|
|
||||||
if (mouseDownMenuBar) {
|
if (mouseDownMenuBar) {
|
||||||
|
|
||||||
setMenuBarLeft(mouseX - mouseMenuBarOffsetX)
|
setMenuBarLeft(mouseX - mouseMenuBarOffsetX)
|
||||||
@@ -238,7 +246,7 @@ export default function App() {
|
|||||||
return (
|
return (
|
||||||
|
|
||||||
<div onMouseMove={e => handleMouseMove(e)} style={{overflow: "unset"}}>
|
<div onMouseMove={e => handleMouseMove(e)} style={{overflow: "unset"}}>
|
||||||
<canvas id="canvas" style={{backgroundColor: "rgb(255, 255, 255)"}}
|
<canvas id="canvas" style={{backgroundColor: "rgb(255, 255, 255)", cursor: "crosshair"}}
|
||||||
width={5000}
|
width={5000}
|
||||||
height={3000}
|
height={3000}
|
||||||
onMouseDown={e => {
|
onMouseDown={e => {
|
||||||
@@ -477,7 +485,7 @@ export default function App() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type={"range"} min={1} max={20} value={strokeWidthSliderValue} onChange={e => {
|
<input type={"range"} min={1} max={40} value={strokeWidthSliderValue} onChange={e => {
|
||||||
setStrokeWidthSliderValue(e.currentTarget.value)
|
setStrokeWidthSliderValue(e.currentTarget.value)
|
||||||
strokeWidth = e.currentTarget.value
|
strokeWidth = e.currentTarget.value
|
||||||
if (selectedTool === "pencil") {
|
if (selectedTool === "pencil") {
|
||||||
|
|||||||
Reference in New Issue
Block a user