Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Flip CGVector-typed properties on macOS - #7636

Merged
1ec5 merged 4 commits into
release-ios-v3.4.0from
1ec5-macos-vector-6066
Jan 9, 2017
Merged

1ec5 merged 4 commits into
release-ios-v3.4.0from
1ec5-macos-vector-6066

Conversation

@1ec5

@1ec5 1ec5 commented Jan 9, 2017 •

Copy link
Copy Markdown
Contributor

On macOS, CGVector is 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 setting NSView.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 MGLColor macro 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 CGVector points upward instead of downward. The guide also indicates the NSValue accessors used for CGVector and NSEdgeInsets/UIEdgeInsets values.

Fixes #6066.

/cc @frederoni @incanus @boundsj

1ec5 added 4 commits January 8, 2017 16:35
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.
@1ec5 1ec5 added bug iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling labels Jan 9, 2017
@1ec5 1ec5 added this to the macos-v0.3.0 milestone Jan 9, 2017
@1ec5 1ec5 self-assigned this Jan 9, 2017
@1ec5
1ec5 requested a review from frederoni January 9, 2017 01:41
@mention-bot

Copy link
Copy Markdown

@1ec5, thanks for your PR! By analyzing this pull request, we identified @incanus and @boundsj to be potential reviewers.

@1ec5 1ec5 changed the title Flipped CGVector-typed properties on macOS Flip CGVector-typed properties on macOS Jan 9, 2017
@1ec5
1ec5 merged commit a4c44c5 into release-ios-v3.4.0 Jan 9, 2017
@1ec5
1ec5 deleted the 1ec5-macos-vector-6066 branch January 9, 2017 09:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants