-
Notifications
You must be signed in to change notification settings - Fork 891
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
Add safe area and document coordinate systems #3890
Open
madsmtm
wants to merge
27
commits into
master
Choose a base branch
from
madsmtm/safe-area
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 18 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
98a9914
Add safe area and document coordinate systems
madsmtm 335a1c6
Attempt to show better show that positions are relative to something
madsmtm 3cd2fa6
Remove extra comment that was more confusing than helpful
madsmtm 9bcd3ff
Improve docs, allow safe area to include transparent title bar
madsmtm bec2ed1
Use possibly negative values for surface position
madsmtm 81c92eb
Fix safe_area on macOS < 11
madsmtm d5d8e30
Fix outer_size on iOS
madsmtm b1fee88
Remove draw.io files from typos check
madsmtm 5df9eb8
Fix doc link
madsmtm da7942e
Fix SurfaceResized on iOS
madsmtm 9f080a5
Always redraw when the safe area changes
madsmtm bc12e13
Properly set up typos check
madsmtm 287fd8d
Add Android, Orbital, Web, Windows, Wayland and X11 implementations
madsmtm ba76cc6
Fix Android inner_position/surface_position name
madsmtm 8561d3b
Fix clippy warning on Windows
madsmtm feb686a
Fix size of desktop coordinate systems image
madsmtm e878c59
Note on android that there's events for safe area insets
madsmtm c7523d4
Add docs on also emitting RedrawRequested when safe area changes
madsmtm 01552d5
Move docs on safe area to # Drawing on the window
madsmtm 45326fb
Remove comment about CSD in safe_area on wayland
madsmtm c651490
Remove fixmes, use issue to track instead
madsmtm c1ea82a
Change note on negative surface position
madsmtm 39f40c7
Make safe area position vs. size a bit clearer
madsmtm 131eaa1
Add dot and arrow to the start and end of position indicators
madsmtm 62a95a5
macOS: Guarantee that SurfaceResized is emitted on safe area change
madsmtm 3b3928e
Don't mention Alacritty
madsmtm 992778a
Comment before mobile picture
madsmtm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" version="24.7.12" pages="2"> | ||
<diagram name="desktop" id="3DDum1nDijUk3y7wIDRm"> | ||
<mxGraphModel dx="1139" dy="747" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1000" pageHeight="600" math="0" shadow="0"> | ||
<root> | ||
<mxCell id="0" /> | ||
<mxCell id="1" parent="0" /> | ||
<mxCell id="cRYnzpdCW-J0f_YpP3mc-1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#E8E8E8;fontColor=#333333;strokeColor=#666666;" parent="1" vertex="1"> | ||
<mxGeometry x="160" y="40" width="560" height="480" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="cRYnzpdCW-J0f_YpP3mc-2" value="" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;fillColor=#dae8fc;strokeColor=#666666;" parent="1" vertex="1"> | ||
<mxGeometry x="240" y="160" width="400" height="80" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="cRYnzpdCW-J0f_YpP3mc-3" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#DBDBDB;strokeColor=#666666;fontColor=#333333;" parent="1" vertex="1"> | ||
<mxGeometry x="160" y="40" width="560" height="40" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="cRYnzpdCW-J0f_YpP3mc-4" value="" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;fillColor=#d5e8d4;strokeColor=#666666;" parent="1" vertex="1"> | ||
<mxGeometry x="240" y="360" width="400" height="80" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="cRYnzpdCW-J0f_YpP3mc-5" value="" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=none;fillColor=#d5e8d4;" parent="1" vertex="1"> | ||
<mxGeometry x="240" y="200" width="400" height="200" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="cRYnzpdCW-J0f_YpP3mc-6" value="" style="endArrow=none;html=1;rounded=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;strokeColor=#666666;" parent="1" source="cRYnzpdCW-J0f_YpP3mc-4" target="cRYnzpdCW-J0f_YpP3mc-2" edge="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="-10" y="330" as="sourcePoint" /> | ||
<mxPoint x="40" y="280" as="targetPoint" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="cRYnzpdCW-J0f_YpP3mc-7" value="" style="endArrow=none;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;strokeColor=#666666;" parent="1" source="cRYnzpdCW-J0f_YpP3mc-4" target="cRYnzpdCW-J0f_YpP3mc-2" edge="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="750" y="590" as="sourcePoint" /> | ||
<mxPoint x="750" y="230" as="targetPoint" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="cRYnzpdCW-J0f_YpP3mc-8" value="" style="endArrow=none;html=1;rounded=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0;entryDx=0;entryDy=0;strokeColor=#666666;" parent="1" source="cRYnzpdCW-J0f_YpP3mc-2" target="cRYnzpdCW-J0f_YpP3mc-5" edge="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="200.00000000000023" y="199.69" as="sourcePoint" /> | ||
<mxPoint x="720.0000000000002" y="199.69" as="targetPoint" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="cRYnzpdCW-J0f_YpP3mc-9" value="<font>outer_position</font>" style="endArrow=none;html=1;strokeWidth=3;rounded=0;exitX=0;exitY=0;exitDx=0;exitDy=0;dashed=1;align=right;fontSize=20;fontFamily=monospace;fontColor=#6C8EBF;labelBackgroundColor=none;spacingLeft=0;spacingRight=15;spacing=0;fillColor=#dae8fc;strokeColor=#6C8EBF;" parent="1" source="cRYnzpdCW-J0f_YpP3mc-3" edge="1"> | ||
<mxGeometry x="-0.3077" y="-33" width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="80" y="160" as="sourcePoint" /> | ||
<mxPoint x="240" y="160" as="targetPoint" /> | ||
<mxPoint as="offset" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="cRYnzpdCW-J0f_YpP3mc-10" value="<font>outer_size</font>" style="endArrow=none;html=1;strokeWidth=3;rounded=0;dashed=1;align=left;fontSize=20;fontFamily=monospace;fontColor=#6C8EBF;labelBackgroundColor=none;spacingLeft=15;spacingRight=0;spacing=0;exitX=1;exitY=0;exitDx=0;exitDy=0;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" source="cRYnzpdCW-J0f_YpP3mc-2" edge="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="850" y="190" as="sourcePoint" /> | ||
<mxPoint x="760" y="440" as="targetPoint" /> | ||
<Array as="points"> | ||
<mxPoint x="890" y="160" /> | ||
<mxPoint x="890" y="440" /> | ||
</Array> | ||
<mxPoint as="offset" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="cRYnzpdCW-J0f_YpP3mc-11" value="<font>surface_size</font>" style="endArrow=none;html=1;strokeWidth=3;rounded=0;dashed=1;align=left;fontSize=20;fontFamily=monospace;fontColor=#82B366;labelBackgroundColor=none;spacingLeft=15;spacingRight=0;spacing=0;entryX=1;entryY=1;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82B366;" parent="1" target="cRYnzpdCW-J0f_YpP3mc-4" edge="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="640" y="200" as="sourcePoint" /> | ||
<mxPoint x="760" y="440" as="targetPoint" /> | ||
<Array as="points"> | ||
<mxPoint x="750" y="200" /> | ||
<mxPoint x="750" y="440" /> | ||
</Array> | ||
<mxPoint as="offset" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="cRYnzpdCW-J0f_YpP3mc-12" value="<font>surface_position</font>" style="endArrow=none;html=1;strokeWidth=3;rounded=0;dashed=1;align=right;fontSize=20;fontFamily=monospace;fontColor=#82B366;labelBackgroundColor=none;spacingLeft=0;spacingRight=15;spacing=0;fillColor=#d5e8d4;strokeColor=#82b366;exitX=0;exitY=0;exitDx=0;exitDy=0;entryX=0;entryY=0;entryDx=0;entryDy=0;curved=1;" parent="1" source="cRYnzpdCW-J0f_YpP3mc-2" target="cRYnzpdCW-J0f_YpP3mc-5" edge="1"> | ||
<mxGeometry y="-70" width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="120" y="160" as="sourcePoint" /> | ||
<mxPoint x="140" y="220" as="targetPoint" /> | ||
<Array as="points"> | ||
<mxPoint x="230" y="180" /> | ||
</Array> | ||
<mxPoint x="-7" y="-31" as="offset" /> | ||
</mxGeometry> | ||
</mxCell> | ||
</root> | ||
</mxGraphModel> | ||
</diagram> | ||
<diagram name="mobile" id="D5mAeJSS4Z33KEKjPCBt"> | ||
<mxGraphModel dx="1025" dy="672" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="720" pageHeight="720" math="0" shadow="0"> | ||
<root> | ||
<mxCell id="0" /> | ||
<mxCell id="1" parent="0" /> | ||
<mxCell id="RxwCrVmIsQwV7z5iJ9nY-1" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E8E8E8;fontColor=#333333;strokeColor=#666666;" parent="1" vertex="1"> | ||
<mxGeometry x="320" y="40" width="320" height="640" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="RxwCrVmIsQwV7z5iJ9nY-2" value="" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1"> | ||
<mxGeometry x="330" y="50" width="300" height="620" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="RxwCrVmIsQwV7z5iJ9nY-4" value="" style="rounded=0;whiteSpace=wrap;html=1;shadow=0;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1"> | ||
<mxGeometry x="340" y="80" width="280" height="560" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="RxwCrVmIsQwV7z5iJ9nY-9" value="safe_area" style="endArrow=none;html=1;strokeWidth=3;rounded=0;dashed=1;align=right;fontSize=20;fontFamily=monospace;fontColor=#D79B00;labelBackgroundColor=none;spacingLeft=0;spacingRight=15;spacing=0;fillColor=#ffe6cc;strokeColor=#d79b00;exitX=0;exitY=0;exitDx=0;exitDy=0;entryX=0;entryY=1;entryDx=0;entryDy=0;" parent="1" source="RxwCrVmIsQwV7z5iJ9nY-4" target="RxwCrVmIsQwV7z5iJ9nY-4" edge="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="170" y="60" as="sourcePoint" /> | ||
<mxPoint x="160" y="110" as="targetPoint" /> | ||
<Array as="points"> | ||
<mxPoint x="280" y="80" /> | ||
<mxPoint x="280" y="640" /> | ||
</Array> | ||
<mxPoint as="offset" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="RxwCrVmIsQwV7z5iJ9nY-12" value="<font>surface_size</font>" style="endArrow=none;html=1;strokeWidth=3;rounded=0;dashed=1;align=right;fontSize=20;fontFamily=monospace;fontColor=#82B366;labelBackgroundColor=none;spacingLeft=0;spacingRight=15;spacing=0;fillColor=#d5e8d4;strokeColor=#82b366;entryX=0;entryY=1;entryDx=0;entryDy=0;" parent="1" target="RxwCrVmIsQwV7z5iJ9nY-2" edge="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="330" y="50" as="sourcePoint" /> | ||
<mxPoint x="320" y="630" as="targetPoint" /> | ||
<Array as="points"> | ||
<mxPoint x="160" y="50" /> | ||
<mxPoint x="160" y="670" /> | ||
</Array> | ||
<mxPoint as="offset" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="RxwCrVmIsQwV7z5iJ9nY-20" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DBDBDB;strokeColor=#666666;fontColor=#333333;" parent="1" vertex="1"> | ||
<mxGeometry x="410" y="640" width="140" height="10" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="RxwCrVmIsQwV7z5iJ9nY-3" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DBDBDB;strokeColor=#666666;fontColor=#333333;" parent="1" vertex="1"> | ||
<mxGeometry x="420" y="50" width="120" height="30" as="geometry" /> | ||
</mxCell> | ||
</root> | ||
</mxGraphModel> | ||
</diagram> | ||
</mxfile> |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
positions are points,
outer_size
iswindow_size
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outer_size
is notwindow_size
currently, and I'm not sure I want it to be? It's already defined onWindow
, so it seems a bit excessive to repeat "window". If anything, I'd rather call it justsize
, but that might lead people to use that oversurface_size
.What do you mean by "positions are points"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a size with all the decorations, which is what we have and that's what we're reporting, so it's effectively a window size.
If you think of window as a part without decorations, probably then not, but in the current state it's window_size from what I can say.
I mean, you show them with lines as in they are areas, but you should just draw them as a point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah, but I wasn't sure how to represent what the point was relative to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe color coding, so different coordinate spaces will be differently colored, though, you already do so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have pushed a new commit that updates the diagram to do something like this: