fix: pen op de lat tekent nu langs de rand i.p.v. de lat te verslepen (v0.3.74-beta)
All checks were successful
dev - build & deploy naar test / build-and-deploy (push) Successful in 27s
All checks were successful
dev - build & deploy naar test / build-and-deploy (push) Successful in 27s
- In de praktijk zet je de pen óp de liniaal-/geodriehoekrand, zoals bij een echte lat - maar dat versleepte het gereedschap, waardoor "langs de lat tekenen" niets leek te doen - Landt de pen (pen/vulpen/stift, penmodus actief) binnen 24px van een tekenrand - ook óp de lat zelf - dan start een vastgeklikte haal en blijft het gereedschap liggen; de events lopen via pointer capture gewoon door naar de inktlaag - Verder van de rand blijft het gereedschap gewoon te verslepen, en de draaiknop houdt voorrang - Startzone naast de lat verruimd van 16 naar 24px (digibord-vingers) - Geverifieerd in headless Chromium: 7 nieuwe checks (tekenen op de randzone zonder de lat te verschuiven, verslepen vanuit het midden, draaien in penmodus, idem geodriehoek) + de bestaande 14 snap-checks blijven groen Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0149FgUQvuwxKKEdvQGmNngF
This commit is contained in:
parent
abafcafe3a
commit
6e7f24eb40
3 changed files with 25 additions and 6 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
|||
0.3.73-beta
|
||||
0.3.74-beta
|
||||
|
|
|
|||
|
|
@ -566,6 +566,19 @@ function makeMovable(t){
|
|||
t.addEventListener("pointerdown", e=>{
|
||||
if(e.target.classList.contains("dtool-x") || e.target.closest(".dtool-opts")) return;
|
||||
e.preventDefault(); e.stopPropagation();
|
||||
/* pen actief en neergezet op de randzone van de lat: tekenen gaat vóór
|
||||
verslepen - zoals je een echte liniaal vasthoudt terwijl je erlangs
|
||||
tekent. Alleen een greep verder van de rand verplaatst het gereedschap. */
|
||||
if(!e.target.classList.contains("dtool-rot")
|
||||
&& document.body.classList.contains("pen")
|
||||
&& ["pen","vulp","mark"].includes(PEN.tool)
|
||||
&& (t.classList.contains("dtool-ruler") || t.classList.contains("dtool-geo"))){
|
||||
const r = bInk.getBoundingClientRect();
|
||||
const px = (e.clientX - r.left) * (board.clientWidth / r.width);
|
||||
const py = (e.clientY - r.top) * (board.clientHeight / r.height);
|
||||
const hit = nearestEdge(px, py);
|
||||
if(hit && hit.d <= 24){ startInkStroke(e); return; }
|
||||
}
|
||||
if(e.target.classList.contains("dtool-rot")){
|
||||
const r = t.getBoundingClientRect();
|
||||
const cx = r.left+r.width/2, cy = r.top+r.height/2;
|
||||
|
|
@ -936,9 +949,10 @@ function snapPoint(x, y){
|
|||
if(Math.hypot(px-qx, py-qy) > 60){ bSnap = null; return [x, y]; }
|
||||
return [qx*k, qy*k];
|
||||
}
|
||||
bInk.addEventListener("pointerdown", e=>{
|
||||
if(e.pointerType==="mouse" && e.button!==0) return;
|
||||
e.preventDefault();
|
||||
/* start van een haal; ook aanroepbaar vanaf de liniaal/geodriehoek zelf
|
||||
(pen op de randzone van de lat = tekenen, niet verslepen) - de pointer
|
||||
capture op bInk stuurt de vervolg-events vanzelf hierheen */
|
||||
function startInkStroke(e){
|
||||
if(PEN.tool==="text"){ startBoardText(e); return; }
|
||||
bInk.setPointerCapture(e.pointerId);
|
||||
bDraw = true;
|
||||
|
|
@ -948,11 +962,16 @@ bInk.addEventListener("pointerdown", e=>{
|
|||
if(PEN.tool!=="erase" && PEN.tool!=="hand"){
|
||||
const k = bInk.width / board.clientWidth;
|
||||
const hit = nearestEdge(bx/k, by/k);
|
||||
if(hit && hit.d <= 16) bSnap = hit;
|
||||
if(hit && hit.d <= 24) bSnap = hit;
|
||||
}
|
||||
[bx,by] = snapPoint(bx, by);
|
||||
bMidX = bMidY = null;
|
||||
bStroke(bx+0.01, by+0.01, e.pressure, e.pointerType);
|
||||
}
|
||||
bInk.addEventListener("pointerdown", e=>{
|
||||
if(e.pointerType==="mouse" && e.button!==0) return;
|
||||
e.preventDefault();
|
||||
startInkStroke(e);
|
||||
});
|
||||
bInk.addEventListener("pointermove", e=>{
|
||||
if(!bDraw) return;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"use strict";
|
||||
/* version — shown until /api/version resolves (or if the fetch fails, e.g. offline).
|
||||
Kept in sync by hand with the VERSION file at the repo root on every release. */
|
||||
const VERSION = "0.3.73-beta";
|
||||
const VERSION = "0.3.74-beta";
|
||||
(function(){
|
||||
const tag = document.getElementById("verTag");
|
||||
tag.textContent = "v"+VERSION;
|
||||
|
|
|
|||
Loading…
Reference in a new issue