screengraft 0.59.0 → 0.59.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/ui/index.html +18 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "screengraft",
|
|
3
|
-
"version": "0.59.
|
|
3
|
+
"version": "0.59.2",
|
|
4
4
|
"description": "Put a UI screenshot or screen recording onto a photographed device screen with the perspective exactly right \u2014 a homography you confirm by hand, not a generative guess.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mockup",
|
package/ui/index.html
CHANGED
|
@@ -2789,7 +2789,7 @@ $('#dofMeasure').onclick = measureDof;
|
|
|
2789
2789
|
on any steep fit (reported 13 Sep 2026). The SOLID line is where focus
|
|
2790
2790
|
ends; the DASHED line is where the blur reaches its full amount, and it can
|
|
2791
2791
|
sit anywhere on the screen or a little past it. Handles:
|
|
2792
|
-
solid line centre -- move focus
|
|
2792
|
+
solid line centre -- move the plane of focus; the limits come with it
|
|
2793
2793
|
dashed line centre -- move where the ramp ends (end); spacing = ramp length
|
|
2794
2794
|
sharp line pips -- turn all lines about the focus line (direction), ⇧ snaps to 15°
|
|
2795
2795
|
second dashed line -- the NEAR limit, when "Both sides" is on: blur grows
|
|
@@ -2881,6 +2881,22 @@ function paintGizmo(){
|
|
|
2881
2881
|
(two ? T([cc[0] - away[0]*off, cc[1] - away[1]*off], `σ ${sigma.toFixed(0)}px from here${beyond2 ? ' · past the screen' : ''}`, 4*k) : '') +
|
|
2882
2882
|
T([th[0] + away[0]*off*1.6, th[1] + away[1]*off*1.6], `${Math.round(dofStr*100)}%`, 4*k);
|
|
2883
2883
|
}
|
|
2884
|
+
// Moving the SHARP line moves the plane of focus -- and the limits go with
|
|
2885
|
+
// it, each keeping its distance, the way a tilt-shift band moves as one thing.
|
|
2886
|
+
// It used to stop at the far line (start <= end - 0.05), so with the dashed
|
|
2887
|
+
// line sitting on the phone's near edge the sharp line could not be placed
|
|
2888
|
+
// over the phone at all: it hit the dashed line and stayed (a screen recording,
|
|
2889
|
+
// 14 Sep 2026). The dashed lines are what change the ramp's length; the sharp
|
|
2890
|
+
// line only ever changes where the ramp is. Reach: -0.5 .. 0.95 along the
|
|
2891
|
+
// screen, the same distance past the glass the far line has -- on a steep,
|
|
2892
|
+
// flat phone the plane of focus is on the table in front of the screen.
|
|
2893
|
+
function moveFocus(f){
|
|
2894
|
+
const was = dofStart;
|
|
2895
|
+
dofStart = Math.max(-0.5, Math.min(0.95, f));
|
|
2896
|
+
const shift = dofStart - was;
|
|
2897
|
+
dofEnd = Math.max(dofStart + 0.05, Math.min(1.5, dofEnd + shift));
|
|
2898
|
+
if (dofEnd2 !== null) dofEnd2 = Math.max(-0.5, Math.min(dofStart - 0.05, dofEnd2 + shift));
|
|
2899
|
+
}
|
|
2884
2900
|
// pointer position in SCREENSHOT pixels
|
|
2885
2901
|
function gizmoPos(e, g){
|
|
2886
2902
|
const rc = gz.getBoundingClientRect();
|
|
@@ -2913,10 +2929,7 @@ gz.addEventListener('pointermove', e => {
|
|
|
2913
2929
|
const f = (p[0]*g.d[0] + p[1]*g.d[1] - g.lo) / (g.hi - g.lo);
|
|
2914
2930
|
const q = (p[0]*g.u[0] + p[1]*g.u[1] - g.ulo) / (g.uhi - g.ulo);
|
|
2915
2931
|
if (gzDrag.h === 'start'){
|
|
2916
|
-
|
|
2917
|
-
// steep, flat phone the plane of focus is on the table in front of the
|
|
2918
|
-
// glass, not on it (reported 14 Sep 2026 — "cannot place it on the photo").
|
|
2919
|
-
dofStart = Math.max(dofEnd2 === null ? -0.5 : dofEnd2 + 0.05, Math.min(0.95, Math.min(f, dofEnd - 0.05)));
|
|
2932
|
+
moveFocus(f);
|
|
2920
2933
|
} else if (gzDrag.h === 'end'){
|
|
2921
2934
|
dofEnd = Math.max(dofStart + 0.05, Math.min(1.5, f));
|
|
2922
2935
|
} else if (gzDrag.h === 'end2'){
|