Repository navigation
Description
What happens
On a point layer whose classes have their own marks (stacked strokes of markers, set in the Symbology pane's Marks section or with layer.lineStrokes and a value), the map draws each mark in its own shape, but the desktop UI's previews don't:
- Triangle, diamond and star marks show as circles in the Layers pane's legend rows and in the Symbology pane's Marks preview.
- A square mark shows as a square but is never turned: a square with
"angle": 20is turned on the map and upright in both panes. - A hash mark over a diamond shows over a circle.
Seen in RustGIS 0.9.0 on Windows desktop, and on main (8f1c5ec).
Steps to reproduce
layer.addDataText={"fileName":"Points.csv","text":"name,type,lon,lat\nA,triangle,10,5\nB,diamond,11,5\nC,star,12,5\nD,square 20°,13,5\n"}
layer.symbology={"layer":"Points","type":"unique","field":"type"}
layer.lineStrokes={"layer":"Points","value":"triangle","strokes":[{"color":"#1565C0","width":0.8,"markers":{"mark":"triangle","size":12,"outline":"#FFFFFF"}}]}
layer.lineStrokes={"layer":"Points","value":"diamond","strokes":[{"color":"#2E7D32","markers":{"mark":"diamond","size":12}},{"color":"#FFFFFF","width":1.5,"markers":{"mark":"hash","size":12,"angle":45,"rotate":false}}]}
layer.lineStrokes={"layer":"Points","value":"star","strokes":[{"color":"#C62828","width":0.8,"markers":{"mark":"star","size":14,"outline":"#000000"}}]}
layer.lineStrokes={"layer":"Points","value":"square 20°","strokes":[{"color":"#6D4C41","width":0.8,"markers":{"mark":"square","size":11,"outline":"#000000","angle":20}}]}
Expand Points in the Layers pane, open Symbology, and in Marks › Marks for pick triangle, then star.
Expected
Each row's patch and the Marks preview show the mark the map draws: a blue triangle, a green diamond under a white 45° hash, a red star, and a brown square turned 20°.
Actual
The triangle, diamond and star classes show circles (the diamond's hash is drawn over a circle), and the square 20° class shows an upright square. The map is right.
Cause
marker_preview in crates/ui-egui/src/panes.rs draws one mark. It handles LineMark::Hash, Marker::Square (upright) and Marker::Char, and its catch-all LineMark::Marker(_) arm draws circle_filled. Every patch of a point layer with marks goes through it (patch_sized → marks_preview → marker_preview). That covers the Layers pane's rows and size rows, the Symbology class rows of repeated values, the symbol editor's swatch, and the Marks preview. So do markers along a line in the stroke editor's preview. The plain-symbol branch of patch_sized (no marks) draws squares, triangles and diamonds separately, with its own proportions (a triangle from −r to +0.8r rather than the map's −1.1r to +0.75r), and stars as circles.
The layout legend is not affected. layout/swatch.rs::point_swatch draws through point_marks::draw, so it uses the map's own marker_path.
Related
- Layout legend: point symbols don't match the map #1441 / fix(layout): draw a legend's points as the map does #1442: the layout legend's points didn't match the map; fixed in the layout renderer.
- [Feature]: Legend swatches show a layer's stacked strokes and fills #2490 / feat(ui): Layers and Symbology patches draw a layer's stacked strokes, fills and marks (#2490) #2534: the Layers and Symbology patches draw a layer's stacked strokes, fills and marks. This issue is the point-mark part of those patches.
- [Bug]: Proportional Symbols on a point layer with stacked marks draws every feature the same size #3400 (open) is a different bug: Proportional Symbols ignores sizes on the map for stacked marks.
Activity
fix(ui): the Layers and Symbology panes draw a point's marks in their…