Skip to content

Commit

Permalink
more resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Jul 18, 2023
1 parent cf37156 commit dfc97d2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/dashboard/DashboardIndexedScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@ export default function DashboardLEDStrip(props: DashboardServiceProps) {
(contextRef.current = canvas.getContext("2d"))
if (!context) return

console.log("RENDER")
// paint image
context.fillStyle = "#222"
context.fillRect(0, 0, canvas.width, canvas.height)
const pixels = server?.pixels
context.clearRect(0, 0, canvas.width, canvas.height)

if (!pixels) {
context.fillStyle = "#222"
context.fillRect(0, 0, canvas.width, canvas.height)
}
}

paint()
Expand All @@ -99,7 +102,7 @@ export default function DashboardLEDStrip(props: DashboardServiceProps) {
}
if (rotation) canvasStyle.transform = `rotate(${rotation}deg)`
const parentStyle: CSSProperties = {
width: "clamp(5rem, 90vw, 20rem)"
width: "clamp(5rem, 90vw, 20rem)",
}

return (
Expand Down

0 comments on commit dfc97d2

Please sign in to comment.