screengraft 0.54.3 → 0.54.5

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/ui/index.html +19 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screengraft",
3
- "version": "0.54.3",
3
+ "version": "0.54.5",
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
@@ -634,11 +634,19 @@
634
634
  #outWrap{position:relative}
635
635
  #dofGizmo{position:absolute;pointer-events:none;opacity:.4;transition:opacity .15s;overflow:visible}
636
636
  #outWrap:hover #dofGizmo,#dofGizmo.drag{opacity:1}
637
- #dofGizmo .case{stroke:rgba(0,0,0,.6);fill:none;vector-effect:non-scaling-stroke}
638
- #dofGizmo .focus{stroke:#f5623d;stroke-width:1.5;fill:none;vector-effect:non-scaling-stroke}
639
- #dofGizmo .far{stroke:#f5623d;stroke-width:1.25;stroke-dasharray:6 6;fill:none;vector-effect:non-scaling-stroke}
640
- #dofGizmo .far.out{stroke-dasharray:3 7;opacity:.75}
641
- #dofGizmo .h{fill:#f5623d;stroke:#fff;stroke-width:1.5;vector-effect:non-scaling-stroke;pointer-events:auto;cursor:grab}
637
+ /* Same rules as the fit overlay (v0.54.3): thin core, a light casing
638
+ underneath at 45% black, dashes 6/5. The casing is what survives a
639
+ photograph; the thinness is the request. */
640
+ #dofGizmo .case{stroke:rgba(0,0,0,.45);fill:none;vector-effect:non-scaling-stroke}
641
+ #dofGizmo .focus{stroke:#f5623d;stroke-width:1;fill:none;vector-effect:non-scaling-stroke}
642
+ #dofGizmo .far{stroke:#f5623d;stroke-width:0.8;fill:none;vector-effect:non-scaling-stroke}
643
+ #dofGizmo .far.out{opacity:.75}
644
+ /* Dash lengths are set inline in photo px scaled by the zoom (SVG dashes
645
+ are viewBox units; non-scaling-stroke does not cover them), so they read
646
+ as 6/5 on screen at any zoom -- the fit overlay's GUIDE_DASH. */
647
+ #dofGizmo .h{fill:#f5623d;stroke:#fff;stroke-width:1.2;vector-effect:non-scaling-stroke;pointer-events:auto;cursor:move}
648
+ #dofGizmo .h.pip{cursor:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='M17.5 11a6.5 6.5 0 1 1-2.2-4.9' fill='none' stroke='rgba(0,0,0,.85)' stroke-width='4.2' stroke-linecap='round'/%3E%3Cpath d='M17.5 11a6.5 6.5 0 1 1-2.2-4.9' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M15.6 2.6l0.4 4.2-4.2 0.3' fill='none' stroke='rgba(0,0,0,.85)' stroke-width='4.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M15.6 2.6l0.4 4.2-4.2 0.3' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 11 11, crosshair}
649
+ #dofGizmo .h.thumb{cursor:ew-resize}
642
650
  #dofGizmo .h.hollow{fill:#1a1a1a}
643
651
  #dofGizmo .h.pip{fill:#f5623d}
644
652
  #dofGizmo .h.thumb{fill:#fff;stroke:#f5623d;stroke-width:2}
@@ -1489,7 +1497,7 @@ const ROTATE_CURSOR = 'url("data:image/svg+xml;utf8,' + encodeURIComponent(
1489
1497
  '<path d="M15.6 2.6l0.4 4.2-4.2 0.3" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>' +
1490
1498
  '</svg>') + '") 11 11, crosshair';
1491
1499
  const QUAD_W = 0.8, QUAD_ACTIVE_W = 1.5, GUIDE_W = 0.8, CASE_PAD = 1.6;
1492
- const GUIDE_DASH = [10, 7];
1500
+ const GUIDE_DASH = [6, 5];
1493
1501
  function cased(c, path, coreW, coreColor, dash){
1494
1502
  c.save();
1495
1503
  if (dash) c.setLineDash(dash);
@@ -2723,13 +2731,15 @@ function paintGizmo(){
2723
2731
  const r = 6 * k, rp = 4 * k, fs11 = 11 * k, off = 14 * k;
2724
2732
  const L = (x, y, cls, extra='') => `<line x1="${x[0]}" y1="${x[1]}" x2="${y[0]}" y2="${y[1]}" class="${cls}" ${extra}/>`;
2725
2733
  const T = (p, txt, dy) => `<text x="${p[0]}" y="${p[1] + dy}" text-anchor="middle" font-size="${fs11}">${txt}</text>`;
2734
+ // GUIDE_DASH in screen px, expressed in photo px; a line past the screen gets a sparser dash
2735
+ const dash = out => `stroke-dasharray="${(out ? 3 : GUIDE_DASH[0]) * k} ${(out ? 6 : GUIDE_DASH[1]) * k}"`;
2726
2736
  const away = unit(sub(bc, ac)); // label offsets: away from the other line
2727
2737
  const beyond = dofEnd > 1.0001;
2728
2738
  const beyond2 = two && dofEnd2 < -0.0001;
2729
2739
  gz.innerHTML =
2730
- L(a0, a1, 'case', 'stroke-width="4"') + L(a0, a1, 'focus') +
2731
- L(b0, b1, 'case', 'stroke-width="3.5"') + L(b0, b1, 'far' + (beyond ? ' out' : '')) +
2732
- (two ? L(c0, c1, 'case', 'stroke-width="3.5"') + L(c0, c1, 'far' + (beyond2 ? ' out' : '')) : '') +
2740
+ L(a0, a1, 'case', 'stroke-width="2.6"') + L(a0, a1, 'focus') +
2741
+ L(b0, b1, 'case', `stroke-width="2.4" ${dash(beyond)}`) + L(b0, b1, 'far' + (beyond ? ' out' : ''), dash(beyond)) +
2742
+ (two ? L(c0, c1, 'case', `stroke-width="2.4" ${dash(beyond2)}`) + L(c0, c1, 'far' + (beyond2 ? ' out' : ''), dash(beyond2)) : '') +
2733
2743
  `<circle cx="${a0[0]}" cy="${a0[1]}" r="${rp}" class="h pip" data-h="rotA"/>` +
2734
2744
  `<circle cx="${a1[0]}" cy="${a1[1]}" r="${rp}" class="h pip" data-h="rotB"/>` +
2735
2745
  `<circle cx="${ac[0]}" cy="${ac[1]}" r="${r}" class="h" data-h="start"/>` +