Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[widget Audit] toga.Canvas #2029

Merged
merged 67 commits into from Oct 5, 2023
Merged
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
bd1a2a9
Updated documentation for Canvas.
freakboy3742 Jul 9, 2023
dc57388
Update docstrings, core API, and canvas examples.
freakboy3742 Jul 11, 2023
ab6f9f6
Complete documentation audit and add changenotes.
freakboy3742 Jul 12, 2023
20b3556
Core Canvas widget tests ported.
freakboy3742 Jul 12, 2023
c87c837
Initial canvas probe implementations for Cocoa and iOS.
freakboy3742 Jul 14, 2023
c8aa596
Initial GTK Cairo fixes plus probe.
freakboy3742 Jul 14, 2023
83a2b72
Merge branch 'gtk-font-tests' into audit-canvas
freakboy3742 Jul 14, 2023
440f3be
Make the Cocoa sRGB conversion conditional on an ICC profile existing.
freakboy3742 Jul 15, 2023
2a4fb29
Add a __len__ operation to context, and expanded canvas tutorial.
freakboy3742 Jul 15, 2023
3ae60c1
Allow for a default font on write_text, and correct docs on text origin.
freakboy3742 Jul 15, 2023
1b09a23
Cocoa Canvas at 100% coverage.
freakboy3742 Jul 15, 2023
43d765a
iOS canvas at 100% coverage.
freakboy3742 Jul 15, 2023
c9453d4
Mark Dummy interface as not required, and update Winforms/Android int…
freakboy3742 Jul 15, 2023
91648c9
GTK Canvas at 100% coverage.
freakboy3742 Jul 15, 2023
4e88fb2
Correct GTK multiline text handling.
freakboy3742 Jul 15, 2023
dd03691
Correct transparency handling on iOS.
freakboy3742 Jul 15, 2023
5dc4c2c
Exclude Font from dummy interface checks.
freakboy3742 Jul 15, 2023
de81c39
Disable multiline text test on GTK.
freakboy3742 Jul 15, 2023
d15ed48
Enable capture of test failure screenshots.
freakboy3742 Jul 16, 2023
39c501a
Rework reference variant handling to allow for more complex variant d…
freakboy3742 Jul 16, 2023
4c5e816
Merge branch 'gtk-font-tests' into audit-canvas
freakboy3742 Jul 17, 2023
d033c1e
Merge branch 'gtk-font-tests' into audit-canvas
freakboy3742 Jul 26, 2023
55ba727
Merge branch 'gtk-font-tests' into audit-canvas
freakboy3742 Jul 26, 2023
9fc0aef
Scale up canvas reference images to 200x200.
freakboy3742 Jul 27, 2023
3df8899
Set final test error thresholds.
freakboy3742 Jul 28, 2023
9c8271f
Merge branch 'gtk-font-tests' into audit-canvas
freakboy3742 Aug 4, 2023
66a613b
Merge branch 'gtk-font-tests' into audit-canvas
freakboy3742 Aug 25, 2023
b8370a1
Merge remote-tracking branch 'origin/main' into audit-canvas
mhsmith Sep 14, 2023
67834ee
Make Widget.add, insert, remove and clear throw an exception if calle…
mhsmith Sep 17, 2023
5fccc5c
Documentation cleanups
mhsmith Sep 17, 2023
f793e53
Remove redundant can_have_children methods
mhsmith Sep 17, 2023
bba6824
Fix grammar
mhsmith Sep 17, 2023
142ec17
WinForms Canvas working in examples/canvas and tutorial4
mhsmith Sep 17, 2023
399b3e1
All WinForms Canvas tests passing except transparency, text and input
mhsmith Sep 20, 2023
ee334a1
WinForms Canvas input tests passing
mhsmith Sep 21, 2023
8e336af
Canvas docs clarifications
mhsmith Sep 21, 2023
233adb2
Remove redundant DrawingOperation documentation
mhsmith Sep 24, 2023
561828a
Fix WinForms Canvas test_transparency
mhsmith Sep 25, 2023
fa57ae9
Add method hyperlinks to DrawingObject subclass list
mhsmith Sep 25, 2023
146190a
All WinForms Canvas tests passing at both 100% and 125% scale, except…
mhsmith Sep 25, 2023
78eaf7f
Correct transparency handling on Cocoa canvas.
freakboy3742 Sep 25, 2023
fd7bb64
tutorial4 working on Android, except for text
mhsmith Sep 26, 2023
ae4f0ed
Canvas testbed passing on Android, except for text
mhsmith Sep 26, 2023
1a8d1cc
Add text baseline setting, update tests, and fix on WinForms
mhsmith Sep 27, 2023
1a7f57d
Update core Canvas tests
mhsmith Sep 27, 2023
c1611e6
Merge remote-tracking branch 'remotes/origin/main' into audit-canvas
mhsmith Sep 28, 2023
dbb70c6
Correct WinForms text issues
mhsmith Sep 28, 2023
16d622d
Merge branch 'canvas-tmp' into audit-canvas
mhsmith Sep 28, 2023
d9c61fd
Implement write_text baseline on Cocoa and iOS, and correct font sizes
mhsmith Sep 28, 2023
da05a42
Make MIDDLE and BOTTOM refer to the entire text block, and add roundi…
mhsmith Sep 30, 2023
9139042
Update MIDDLE and BOTTOM on WinForms, and update tests to verify it
mhsmith Sep 30, 2023
a975cab
Make Cocoa draw text lines separately
mhsmith Sep 30, 2023
9fe6c4a
Make WinForms default font follow the system theme
mhsmith Sep 30, 2023
e5c02a9
Cocoa: align ALPHABETIC baseline with a logical pixel
mhsmith Sep 30, 2023
cadc219
Cocoa: switch from drawAtPoint to drawWithRect
mhsmith Oct 1, 2023
425e6d4
Add definitions of CSS pixels and points
mhsmith Oct 1, 2023
86a2012
Copy Cocoa text implementation to iOS, and add tests for multi-size b…
mhsmith Oct 2, 2023
7cf6ce1
Android: implement Canvas text rendering
mhsmith Oct 2, 2023
1e0f349
Update WinForms text reference image
mhsmith Oct 2, 2023
8d486b4
Minor tweaks to sizing descriptions
freakboy3742 Oct 2, 2023
488403d
Rewrite GTK Canvas text rendering to use Pango
mhsmith Oct 4, 2023
d87dd61
More tweaks to sizing descriptions
mhsmith Oct 5, 2023
e97d1b4
GTK: refresh font map after loading a font
mhsmith Oct 5, 2023
6cf78a9
Android Canvas at 100% coverage
mhsmith Oct 5, 2023
d04ff97
WinForms Canvas at 100% coverage
mhsmith Oct 5, 2023
c6a18ed
Implement HTML behavior when drawing on an empty path (Android, Cocoa…
mhsmith Oct 5, 2023
d7f4e2e
Base Cocoa and iOS line height on font metrics
mhsmith Oct 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions docs/background/topics/layout.rst
Expand Up @@ -26,9 +26,7 @@ When a refresh is requested on a container, any sub-containers will also be refr
Length units
============

Toga uses CSS units in its public API. All size calculations assume that the user has a
96 DPI display; if the user has a higher density display, the sizes that are applied
will be scaled accordingly. In practice, this means that:
Toga uses CSS units in its public API. Their physical size depends on the device type:

mhsmith marked this conversation as resolved.
Show resolved Hide resolved
* A CSS pixel is about 1/96 of an inch (0.26 mm) on a desktop screen, and about 1/160 of
an inch (0.16 mm) on a phone screen.
Expand All @@ -37,7 +35,7 @@ will be scaled accordingly. In practice, this means that:

Toga only uses points to measure font sizes. All other lengths are expressed as pixels.

For a full explanation of size interpretations, see `this article
For a full explanation of CSS units, see `this article
<https://hacks.mozilla.org/2013/09/css-length-explained/>`__.

Implementation notes
Expand Down