Esri / arcgis-maps-sdk-dotnet-toolkit

Toolkit for ArcGIS Maps SDK for .NET
https://esri.github.io/arcgis-maps-sdk-dotnet-toolkit/
Apache License 2.0
211 stars 121 forks source link

wpf: PopupViewer bugfixes wave 2 #518

Closed mstefarov closed 1 year ago

mstefarov commented 1 year ago

I found and fixed a few bugs in WPF PopupViewer during the past 3 months, but didn't get a chance to do a write-up and submit them yet. Here is batch 2 of 3.

Font size fixes

FlowDocument's default font size is smaller than intended (12 instead of 14). This means we defaulted to "small" instead of "medium", which threw all relative sizing off. Also, an extra space prevented "large" font size from parsing properly. Example from the Living Atlas:

Before
Before
After
After
Reference
Reference (AGOL)

Implement colspan and rowspan for tables

WPF tables already support rowspan/colspan, so this was a trivial TODO to implement. Example from the Living Atlas

Before
Before
After
After
Reference
Reference (AGOL)

Apply alignment to TableCells and ListItems

Turns out TableCells and ListItems do not extend Block in WPF, but instead have their own copies of the TextAlignment property. This resulted in badly-aligned tables on a few maps, e.g. the on the infamous "road signs" one. This thing is like an Acid test for popup rendering. We can't match reference rendering yet, but we're getting closer! 🙂

2023-06-26_094911 Toolkit SampleApp WPF < Before 2023-06-24_223639 Toolkit SampleApp WPF < After 2023-06-24_223746 msedge < Reference (AGOL)

Apply style to links

There was a missing call to ApplyStyle when rendering links in WPF. This means links always had default styling and didn't pick up e.g. color / bold / italic attributes.