Dash a line's parts behind the surface, and the Draw tool's rubber band there

A line item gains an optional depthFailDash ({ length, pattern16? }): the
parts behind the surface are dashed in depthFailColor, as a dash style
dashes a line. Without a depthFailColor, and on draped lines, it is
ignored; a renderer that predates it draws those parts solid. The Cesium
draw port gives the depth-fail appearance a PolylineDash material, and a
change of dash is a new look. The Draw tool's rubber band uses
{ length: 16 }, the dash its old entity asked for (that entity, a dynamic
polyline, never drew its depth-fail material, so the parts behind the
surface were hidden before the tool moved onto the draw port).
This commit is contained in:
Sameh Khamis committed 2026-11-07 21:49:25 -08:00
1 parent 90e73f2ef2
commit 7ad65b2e87
10 files changed
+115 -2

No files matched your search

+2
View File
@@ -184,7 +184,9 @@ export function initDrawTool({
color: withAlpha(cssColor(PREVIEW[color] || PREVIEW.primary), 0.9),
length: 16,
},
// Dashed behind the surface too, as the band in front of it is.
depthFailColor: withAlpha(cssColor(PREVIEW.primary), 0.35),
depthFailDash: { length: 16 },
},
]);
};
@@ -448,6 +448,7 @@ test('the rubber band follows the pointer, closes an area and takes the chosen c
[139 / 255, 233 / 255, 1, 0.35],
'behind the surface it stays the primary colour, as before',
);
assert.deepEqual(band().depthFailDash, { length: 16 }, 'and dashed there');
assert.equal(band().style.kind, 'dash');
assert.equal(band().style.length, 16);
assert.equal(band().widthPx, 3);