Repository navigation
Sum limits under and over as typed; WPF quick bar font; WinUI demo light theme [no-new-version] - #61
Merged
Merged
Conversation
…Sharp [no-new-version] The controls of WPF for Windows Forms (net10.0-windows, net481), over the view of Rendering: Skia draws the equation into a bitmap that the window shows (no GDI+ drawing), each glyph a path of its outline; the floating bar is a form that never takes the focus, drawn with Skia too. Tests and a demo, on Windows only. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SyVioB8cEKzWWZ7KQGzLfe
SharpEquations.Uno targets WinUI 3 of the Windows App SDK as well (net10.0-windows10.0.19041): the same code, against Microsoft.WinUI. The target builds on every system, so that the package packed on Linux has it; the GlobalStaticResources of the XAML generator of Uno are in an API file of the Uno targets only. The demo runs on WinUI too (Windows only). SkiaSharp 4.156.0 and HarfBuzzSharp 14.4.0.100 are pinned for the whole repository, Avalonia included (it brought SkiaSharp 3), and for the native libraries that Uno.Sdk adds by itself. Windows Forms uses SKPathBuilder. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SyVioB8cEKzWWZ7KQGzLfe
…o-new-version] Setting Padding in the constructor of MathEditBox laid out the equation through OnPaddingChanged before View was made, and every editor failed with a NullReferenceException. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SyVioB8cEKzWWZ7KQGzLfe
… same n-ary operator [no-new-version] ∑^2, a space, then _2 gave the subscript of the whole sum, 〖∑^2〗_2 (the same for ∫, and for x^2 then _3), which no UnicodeMath reads: the second script began a run of its own whose base was the built structure. A _ or ^ typed just after a structure that has only the other script now takes the structure back as linear text into its run, so that both build up together, as when they are typed in one go. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SyVioB8cEKzWWZ7KQGzLfe
…the editor first [no-new-version] The picture of the equation was recorded again only when the view asked for a measure. A parent with a layout of its own (the FlowLayoutPanel of the demo, whose labels change at each key) measured the editor before its view heard of the edit, so the view asked only for the caret: the caret moved, and the text typed was not drawn until it built up. The picture is now recorded again whenever the layout it was made of is not that of the view. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SyVioB8cEKzWWZ7KQGzLfe
…no-new-version] The scripts of an msubsup whose base is a token took no account of the height and the depth of the base, as for a letter (TeX, rule 18a): the lower limit of an integral in display, which is made larger and centred on the axis, was halfway down it. A large operator is a box of its own (TeX, rule 13): its scripts drop from its top and its bottom. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SyVioB8cEKzWWZ7KQGzLfe
…rsion] On WinUI 3 the app without App.xaml had no XAML metadata provider, which the XAML compiler writes for one: XamlControlsResources could not resolve its own types and failed with 'Cannot find a resource with the given key: AcrylicBackgroundFillColorDefaultBrush'. The App hands WinUI the metadata provider of the controls on Windows. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SyVioB8cEKzWWZ7KQGzLfe
…ts of its kind [no-new-version] ∑_(i=1)^n typed and built up by a space, before its operand, was read by UnicodeMath as an operator with scripts: the limits went at its right, and the LaTeX wrote \sum\nolimits, while the same equation built down and up again had them under and over it. The run is read again with an empty operand, and the operator takes the limits it has there: under and over a sum in display, at the right of an integral. A limit over or under it, reopened when the other limit is typed, goes back to the text it was typed as (∑^2, not ∑┴2). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SyVioB8cEKzWWZ7KQGzLfe
…he equation [no-new-version] The popup of the bar inherited the font size of the editor (28 in the demo), and its buttons were much larger than the rest of the user interface. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SyVioB8cEKzWWZ7KQGzLfe
With the dark theme of Windows, WinUI wrote the text of the demo, the equation included, white on its white page: nothing typed could be seen. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SyVioB8cEKzWWZ7KQGzLfe
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SyVioB8cEKzWWZ7KQGzLfe # Conflicts: # src/SharpEquations.Editing/MathEditor.cs # tests/SharpEquations.Avalonia.Tests/Controls/MathEditBoxTests.cs # tests/SharpEquations.Avalonia.Tests/Editing/BuildUpTests.cs
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes for findings from testing the editor on Avalonia, WPF and WinUI.
Editing: an n-ary operator built up before its operand takes the limits of its kind
Typing
\sum_(i=1)^n i^2put the limits at the right of the sum (\sum\nolimits_{i=1}^nin the LaTeX output). After Build down then Build up, the same equation had them under and over, as in Word. The bug showed in both Avalonia and WPF.∑_(i=1)^nbefore its operand is typed. On its own, UnicodeMath reads it as an operator with scripts (msubsup). With an operand, it reads it asmunderover.BuildUp.Parsereads the run again with an empty operand (▒〖〗) and keeps the limits the parser gives there. A sum or product in display getsmunder/mover/munderover. An integral, or ∯, keeps its scripts at the right. LaTeX input already read\sum_{i=1}^nthis way.∑^2), not∑┴2.WPF: the floating bar in the font of the system
The popup inherited the font size of the editor (28 in the demo), so its buttons were much larger than the rest of the interface. The bar now uses
SystemFonts.MessageFontSizeandMessageFontFamily.Uno demo: the white page in the light theme on WinUI
With the dark theme of Windows, WinUI wrote all the text of the demo white on its white page, the equation included, so nothing typed could be seen. The page now requests
ElementTheme.Light.Verified
LimitsOfAnNaryOperatornow expects the limits of\sumunder and over.Not in this PR
On Avalonia, the floating bar can cover controls under the editor when the selection is at its bottom. Fixing it changes how the bar behaves (open it above the equation, or close it when the pointer leaves), so it waits for a decision.
The branch also merges the old branch of #60, merged by squash. That merge leaves the content of
mainunchanged.Generated by Claude Code