-
Notifications
You must be signed in to change notification settings - Fork 6k
[macOS] Top-left origin for PlatformView container #42523
Conversation
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.
|
||
@implementation FlutterPlatformViewContainer | ||
|
||
- (BOOL)isFlipped { |
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 isYFlipped
or isVerticallyFlipped
? Someday there might be a system where the origin is in the lower right...
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.
This is Cocoa method that needs to be overriden to switch into a sane coordinate system...
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.
Ahh, OK, so no choice there then.
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.
Someday there might be a system where the origin is in the lower right...
Please don't give them any suggestions...
shell/platform/darwin/macos/framework/Source/FlutterMutatorView.mm
Outdated
Show resolved
Hide resolved
|
||
@implementation FlutterPlatformViewContainer | ||
|
||
- (BOOL)isFlipped { |
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.
This is Cocoa method that needs to be overriden to switch into a sane coordinate system...
For consistency with Flutter (and all other platforms), Flutter views in the macOS embedder set `isFlipped` to ensure a co-ordinate system with the origin in the top-left, with y co-ordinates increasing towards the bottom edge of the view. Previously, we were using a stock NSView as the container, which uses a bottom-left origin by default. Instead we extract the PlatformView container view as its own class with `isFlipped` true. This doesn't correct the issue of the view anchorpoint/position but does correct rotation direction. This also applies the transform back to origin prior to other transforms when adjusting the platformview position rather than after. Issue: flutter/flutter#124490
…128158) flutter/engine@8769e9c...5429372 2023-06-03 jonahwilliams@google.com [Impeller] Fix 1-d grid computation for compute (flutter/engine#42516) 2023-06-02 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from PuYA-6NVHeHPlkCdk... to VtLnfLmVda1_h1AtM... (flutter/engine#42529) 2023-06-02 chris@bracken.jp [macOS] Top-left origin for PlatformView container (flutter/engine#42523) 2023-06-02 skia-flutter-autoroll@skia.org Manual roll Dart SDK from 9d8df2a5210b to d198f84f5e4e (1 revision) (flutter/engine#42527) 2023-06-02 flar@google.com Revert "Reland "add non-rendering operation culling to DisplayListBuilder" (#41463)" (flutter/engine#42525) 2023-06-02 godofredoc@google.com Move benchmarks no upload to staging. (flutter/engine#42524) 2023-06-02 mdebbar@google.com [web] Support platform view creation params (flutter/engine#42255) 2023-06-02 goderbauer@google.com MultiView changes for dart:ui (flutter/engine#42493) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from PuYA-6NVHeHP to VtLnfLmVda1_ If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC jonahwilliams@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
For consistency with Flutter (and all other platforms), Flutter views in the macOS embedder set
isFlipped
to ensure a co-ordinate system with the origin in the top-left, with y co-ordinates increasing towards the bottom edge of the view.Previously, we were using a stock NSView as the container, which uses a bottom-left origin by default. Instead we extract the PlatformView container view as its own class with
isFlipped
true.This doesn't correct the issue of the view anchorpoint/position but does correct rotation direction.
This also applies the transform back to origin prior to other transforms when adjusting the platformview position rather than after.
Issue: flutter/flutter#124490
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.