@weasel-js/diagram-formats 1.11.1 → 1.12.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/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { diagramThemeFrom, DIAGRAM_THEME_KEY, diagramLabelOf, offPageSplits, diagramScene, themeDocValue, diagramShape, markShape, documentBoundsOf, dataNodeStyle, dataEdgeStyle, diagramEdgeOf, diagramContainerOf, NODE_STROKE_WIDTH, dataRegionStyle, poolAxisOf, titleIdOf, layoutOwnsRoute, EDGE_STROKE_WIDTH, diagramThemeOf, edgeIdOf, layoutOwnsPort, DEFAULT_PORTS, LANE_STROKE_WIDTH } from '@weasel-js/diagram';
2
- import { placedPagesOf, layoutPages, PAGES_DOC_KEY, isAnnotationLayer, boundsOfPath, layoutTextPose, warmRender, renderSceneToPixels, planPixelRender, viewToMat3, createRasterSession, pageHolding, effectivePose, derivedDepOf, pageName, derivedPartsOf, createScene, mat3 } from '@weasel-js/core';
2
+ import { placedPagesOf, layoutPages, PAGES_DOC_KEY, isAnnotationLayer, boundsOfPath, layoutTextPose, warmRender, renderSceneToPixels, planPixelRender, viewToMat3, createRasterSession, pageHolding, effectivePose, derivedDepOf, pageName, derivedPartsOf, INHERIT, resolvePartPaint, createScene, mat3 } from '@weasel-js/core';
3
3
  import { svgNodesFromKit, svgLeafFromKit, warmSvg, serializeSvg, escapeAttr, svgPaintFromKit, svgStrokeFromKit } from '@weasel-js/svg';
4
4
  import { writePdf, registryFontSource } from '@weasel-js/pdf';
5
5
 
@@ -2978,12 +2978,11 @@ function diagramPainted(painters, node, pose) {
2978
2978
  return painter.paint(node, pose).flatMap((cmd) => commandNode(cmd, at) ?? []);
2979
2979
  }
2980
2980
  function derivedNodes(path, data) {
2981
- const parts = derivedPartsOf(path) ?? [{ path }];
2982
- return parts.flatMap((part) => svgLeafFromKit({
2983
- path: part.path,
2984
- ...part.fill !== void 0 ? { fill: part.fill } : data.fill !== void 0 ? { fill: data.fill } : {},
2985
- stroke: part.stroke !== void 0 ? part.stroke : data.stroke
2986
- }, boundsOfPath(part.path)) ?? []);
2981
+ const parts = derivedPartsOf(path) ?? [{ path, fill: INHERIT, stroke: INHERIT }];
2982
+ return parts.flatMap((part) => svgLeafFromKit(
2983
+ { path: part.path, ...resolvePartPaint(part, data) },
2984
+ boundsOfPath(part.path)
2985
+ ) ?? []);
2987
2986
  }
2988
2987
  var one = (nodes) => nodes.length === 0 ? null : nodes.length === 1 ? nodes[0] : { kind: "group", children: nodes };
2989
2988
  function pageSvgNodes(scene, page) {
@@ -3089,7 +3088,8 @@ function pageRasterizer(session) {
3089
3088
  scene: empty,
3090
3089
  sourceRect: { x: -toRaster[6] / sx, y: -toRaster[7] / sy, width: rect.width * scale / sx, height: rect.height * scale / sy },
3091
3090
  scale: { x: sx, y: sy },
3092
- overlay: [{ kind: "group", transform: toPixels, children: [...commands] }]
3091
+ overlay: [{ kind: "group", transform: toPixels, children: [...commands] }],
3092
+ screen: toPixels
3093
3093
  });
3094
3094
  };
3095
3095
  }