ntk 8.20.0 → 8.21.0
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/lib/app.js +11 -0
- package/lib/path.js +4 -1
- package/lib/widgets/svgview.js +1118 -82
- package/package.json +1 -1
package/lib/app.js
CHANGED
|
@@ -25,6 +25,7 @@ import { DEFAULT_RASTER_POLICY, defaultRasterizer } from './rasterize.js';
|
|
|
25
25
|
import { dropShadowSurfaces } from './shadow.js';
|
|
26
26
|
import { sharedGlyphsFor } from './sharedglyphs.js';
|
|
27
27
|
import { ShmUploader } from './shm-upload.js';
|
|
28
|
+
import Surface from './surface.js';
|
|
28
29
|
import FontManager from './text/fontmanager.js';
|
|
29
30
|
import Window from './window.js';
|
|
30
31
|
import * as xevents from './events_map.js';
|
|
@@ -967,6 +968,16 @@ export default class App {
|
|
|
967
968
|
return new Pixmap(this, args);
|
|
968
969
|
}
|
|
969
970
|
|
|
971
|
+
/**
|
|
972
|
+
* An offscreen `Surface` on this connection — `new Surface(app, args)`,
|
|
973
|
+
* for code that has an app in hand and not the module: what `SvgView`
|
|
974
|
+
* draws a masked element on, without the SVG subpath loading the X11
|
|
975
|
+
* client.
|
|
976
|
+
*/
|
|
977
|
+
createSurface(args) {
|
|
978
|
+
return new Surface(this, args);
|
|
979
|
+
}
|
|
980
|
+
|
|
970
981
|
/**
|
|
971
982
|
* The XFIXES extension for this connection, loaded once and shared.
|
|
972
983
|
*
|
package/lib/path.js
CHANGED
|
@@ -454,7 +454,10 @@ export function parseSvgPath(d) {
|
|
|
454
454
|
}
|
|
455
455
|
const nx = rel ? x + e : e;
|
|
456
456
|
const ny = rel ? y + f : f;
|
|
457
|
-
|
|
457
|
+
// one segment, for a marker: the curves it is cut into but the last
|
|
458
|
+
// end at no vertex of the path's
|
|
459
|
+
const arc = svgArcCommands(x, y, rx, ry, rot, large, sweep, nx, ny);
|
|
460
|
+
arc.forEach((c, k) => cmds.push(k < arc.length - 1 ? { ...c, arcPart: true } : c));
|
|
458
461
|
x = nx;
|
|
459
462
|
y = ny;
|
|
460
463
|
break;
|