Skip to content

Commit

Permalink
feat: fix type errors in ui input elements
Browse files Browse the repository at this point in the history
  • Loading branch information
EGRrqq committed Feb 16, 2024
1 parent 50ec457 commit 81302d6
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import "./style.css";
import { CanvasController } from "./canvasController";
import { MouseController, TouchController } from "./canvasController/inputs";
import { Pen, ToolsController } from "./canvasController/tools";
import { CacheController } from "./canvasController/canvasData/cache";
import {
CacheController,
StateController,
} from "./canvasController/canvasData/cache";
import {
Dropdown,
clearBtnController,
Expand Down Expand Up @@ -105,13 +108,17 @@ if (boardController.ctx) {
toolsController.tools[pen.type].settings.lineWidth.toString();

pickerController.value = defaultPenColor;
pickerController.onChange((ev) => {
toolsController.activeTool.settings.strokeStyle = ev.target.value;
pickerController.onChange((e) => {
toolsController.activeTool.settings.strokeStyle = (
e.target as HTMLInputElement
).value;
});

rangeController.value = defaultLineWidth;
rangeController.onChange((ev) => {
toolsController.activeTool.settings.lineWidth = ev.target.value;
rangeController.onChange((e) => {
toolsController.activeTool.settings.lineWidth = parseFloat(
(e.target as HTMLInputElement).value
);
});
}

Expand Down

0 comments on commit 81302d6

Please sign in to comment.