ntk 8.12.12 → 8.12.13

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.
@@ -3640,7 +3640,17 @@ class RenderingContext2d {
3640
3640
  const y = Math.min(...ys);
3641
3641
  const w = Math.max(...xs) - x;
3642
3642
  const h = Math.max(...ys) - y;
3643
- if (!(w > 0 && h > 0)) return null;
3643
+ // A rectangle of no area is still one, and clips everything: what a box
3644
+ // of no height clips its content to, a menu at `max-height: 0`. Taken
3645
+ // for a path, it built the mask the size of the surface, and every
3646
+ // rectangle clipped inside it was intersected into that mask; the
3647
+ // intersection of an empty one is empty, and every consumer draws
3648
+ // nothing through that, as where two rectangles do not meet.
3649
+ if (!(w > 0 && h > 0)) {
3650
+ return Number.isFinite(w) && Number.isFinite(h)
3651
+ ? { x: 0, y: 0, w: 0, h: 0 }
3652
+ : null;
3653
+ }
3644
3654
  // Server clip rectangles are integers, so a fractional edge could only
3645
3655
  // be honoured by rounding — which would differ from the mask path's
3646
3656
  // antialiased edge by up to a pixel. Rare, so leave those to the mask
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ntk",
3
- "version": "8.12.12",
3
+ "version": "8.12.13",
4
4
  "description": "Desktop UI toolkit for X11 with canvas-like 2d and OpenGL rendering",
5
5
  "author": "Andrey Sidorov <sidorares@yandex.ru>",
6
6
  "license": "MIT",