Skip to content
Snippets Groups Projects
Commit c0302492 authored by Yuriy Maksymets's avatar Yuriy Maksymets
Browse files

Fixed render calling code

parent 1a4e447c
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ const getPressureFactor = (pressure) => {
return a * pressure ** 2 + b * pressure + c
}
const PREDICTED_POINT_COLOR = "#00000055"
const PREDICTED_POINT_COLOR = "#00000044"
function faintPoint(x, y) {
return [x, y, 1, PREDICTED_POINT_COLOR]
......@@ -211,7 +211,7 @@ function drawIfRecognized(points, callback, notRecCallback) {
const LAST_RECOGNIZED_PATH_ID = "LSP"
function clearRecognizedUpcoming() {
canvas.renderPath(LAST_RECOGNIZED_PATH_ID, [])
canvas.renderPath(LAST_RECOGNIZED_PATH_ID, [], [])
}
function drawRecognizedUpcoming(points) {
......@@ -221,6 +221,7 @@ function drawRecognizedUpcoming(points) {
canvas.renderPath(
LAST_RECOGNIZED_PATH_ID,
recognizedPoints.map((x) => faintPoint(...x)),
[],
),
clearRecognizedUpcoming,
)
......@@ -407,6 +408,7 @@ canvas.input.addEventListener("strokemove", ({ detail: e }) => {
const pathID = pathIDsByPointerID.get(e.pointerId)
room.extendPath(pathID, attributedPoint(...mousePos, e.pressure))
if (toolSelection.isRecognitionModeSet()) {
console.log("SHULD DR")
drawRecognizedUpcoming(room.getPoints(pathID))
}
} else if (currentTool == toolSelection.Tools.ERASER) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment