This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
Flip CGVector-typed properties on macOS - #7636
Merged
Merged
Conversation
The screen origin is at the lower-left, so offsets and translations increase rightwards and upwards, in contrast to iOS and Web contexts, where the coordinate system increases rightwards and downwards. Duplicated style layer property declarations to reflect this difference.
Eliminated references to MGLColor within style layer headers.
frederoni
approved these changes
Jan 9, 2017
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
On macOS,
CGVectoris now interpreted as extending upward instead of downward, for consistency with the predominant screen origin on that platform. It is possible to flip the screen coordinate system by settingNSView.flipped. However, I’d rather not support that decidedly less common setup, since that would require each MGLStyleLayer instance to maintain a backpointer to MGLMapView.Documentation comments for color-, offset-, and edge insets–typed properties are clearer about their types. In some cases, this meant some additional conditional compilation. There are no longer any references to the
MGLColormacro within the style layer headers.This PR goes in the opposite direction as #6763. I think the result is a net benefit for developers, because Quick Help and jazzy documentation are clearer. For developers who prefer to read the headers, command-clicking leads to the right version of the property. (Command-clicking in Swift code will omit the irrelevant version of the property.)
The “Information for Style Authors” guide explicitly calls out the fact that NSEdgeInsets, UIEdgeInsets, and EdgeInsets are all in counterclockwise order as opposed to the style specification’s clockwise order. For macOS, it also points out that
CGVectorpoints upward instead of downward. The guide also indicates the NSValue accessors used forCGVectorandNSEdgeInsets/UIEdgeInsetsvalues.Fixes #6066.
/cc @frederoni @incanus @boundsj