You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have merged #1457 (v0.3.11), which is a major PR that greatly improves our rendering infrastructure and performance, especially on web. However, it comes with multiple breaking changes, which are documented down below. Please let us know if you have any issues or questions.
To use the new version, run go get cogentcore.org/[email protected] and then go mod tidy. Please note that you must reinstall the core tool (go install cogentcore.org/core/cmd/[email protected]) as there have been changes to it, especially for web.
Improvements
Rendering on web now happens primarily through HTML Canvas functions (stroke, fill, fillText, etc), which results in massive performance improvements
This is particularly notable when scrolling on an app with large amounts of text, such as the docs
Gradient rendering is much faster on web now, as shown by the color picker docs
Text alignment and whitespace enums are now in text instead of styles. For example, styles.Center is now text.Center (only for text; layout alignment still uses styles.Center).
Font styling enums like weight, italic, and decoration are now in rich instead of styles. For example, styles.WeightBold is now rich.Bold and styles.Underline is now rich.Underline.
The property for italic is now called s.Font.Slant instead of s.Font.Style
s.Font.Family is now an enum, with s.Font.CustomFont used for specific font families. Instead of s.SetMono(true), you now set s.Font.Family = rich.Monospace. See the font family docs.
The API for custom fonts has changed (see the new documentation)
The paint API, used in the canvas widget, has changed
If you were accessing low-level things previously that no longer work, please ask us and we can help you update
Some packages and types have been moved around
For example, cogentcore.org/core/parse is now cogentcore.org/core/text/parse
Except for the breaking changes listed earlier, most of these renames should not impact end-user code, but please let us know if you run into any issues.
The old IsVisible has been renamed to IsDisplayable, with the new version of IsVisible checking whether the widget is actually currently visible.
Next steps
This PR is a major redesign of our infrastructure, and it fixes many issues as discussed above. Now that we have completed this significant refactor, we should have more time for addressing other issues and adding new features. Please see the v1 Roadmap (#1526) for an outline of our plans going forward.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We have merged #1457 (v0.3.11), which is a major PR that greatly improves our rendering infrastructure and performance, especially on web. However, it comes with multiple breaking changes, which are documented down below. Please let us know if you have any issues or questions.
To use the new version, run
go get cogentcore.org/[email protected]
and thengo mod tidy
. Please note that you must reinstall the core tool (go install cogentcore.org/core/cmd/[email protected]
) as there have been changes to it, especially for web.Improvements
Breaking changes
text
instead ofstyles
. For example,styles.Center
is nowtext.Center
(only for text; layout alignment still usesstyles.Center
).rich
instead ofstyles
. For example,styles.WeightBold
is nowrich.Bold
andstyles.Underline
is nowrich.Underline
.s.Font.Slant
instead ofs.Font.Style
s.Font.Family
is now an enum, withs.Font.CustomFont
used for specific font families. Instead ofs.SetMono(true)
, you now sets.Font.Family = rich.Monospace
. See the font family docs.Stroke()
and/orFill()
, you now callDraw()
, which does both if applicablepc.StrokeStyle
is nowpc.Stroke
, andpc.FillStyle
is nowpc.Fill
Draw
prefix has been dropped from many functions. For example,DrawCircle
is now justCircle
texteditor
totextcore
andBuffer
toLines
Options
have been renamed toSettings
cogentcore.org/core/parse
is nowcogentcore.org/core/text/parse
IsVisible
has been renamed toIsDisplayable
, with the new version ofIsVisible
checking whether the widget is actually currently visible.Next steps
This PR is a major redesign of our infrastructure, and it fixes many issues as discussed above. Now that we have completed this significant refactor, we should have more time for addressing other issues and adding new features. Please see the v1 Roadmap (#1526) for an outline of our plans going forward.
Beta Was this translation helpful? Give feedback.
All reactions