Fixing Issue with .bounds conflicting with new SKNode class - #48
Open
mpoul1 wants to merge 2 commits into
Open
Conversation
Author
|
Hello! Just a friendly reminder that this PR is ready for review. Please let me know if you need any additional information. @mfessenden |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request: Rename
boundstomapBounds& Fix Camera Description Usage of View BoundsSummary
This PR addresses naming conflicts and clarity issues related to the term
boundsinSKTilemapandSKTiledSceneCamera. The changes:SKTilemapproperty formerly documented asboundstomapBounds(property already existed internally, table docs updated).SKTiledSceneCamerato reference the storedviewBoundsinstead of an implicitboundssymbol, ensuring consistent and safe usage.Motivation / Rationale
boundsis strongly associated withUIView/NSViewsemantics and is also a property Apple may add or reference on SpriteKit nodes. Using a customboundslabel in docs risks confusion and possible future collisions.mapBoundsis already the internal canonical name representing the rendered map’s frame; aligning documentation improves clarity for library consumers.boundsreference which could become ambiguous after the rename. Switching to the explicitviewBoundsincreases maintainability.Detailed Changes
Source Edits
Sources/SKTilemap.swift:| bounds |->| mapBounds |.Sources/SKTiledSceneCamera.swift:description&debugDescriptionnow construct string usingviewBounds.size/viewBounds.roundTo()instead of shadowing any external symbol.No Public API Breaks
Testing / Verification
swift test -v.Build Warnings (Unrelated to This PR)
The following warnings were observed during the build; they predate this PR and are not introduced by the edits:
SKTile,SKTileObject, gameplay kit extension methods, etc.Array2D.contains<T>(_:)(will be an error in Swift 6 language mode).extension CGPoint: Hashablesuggests adding@retroactive.These are potential cleanup tasks for future PRs but intentionally not included here to keep scope minimal and review focused.
Migration Notes
No migration required. For clarity in documentation or samples:
tilemap.boundswithtilemap.mapBoundsif any external README/guide examples exist.Risk Assessment
bounds.Screens / Output Examples
Example new camera description format:
(Clamping / mode data appended as before.)
Follow-Up Suggestions (Optional)
Array2D.contains<T>by renaming inner generic (Element) or constraining directly.openin extension-declared computed properties withpublicto silence override warnings (or move them into primary type declarations if intended for subclassing).@retroactivetoCGPoint: Hashableor remove if no longer needed (CGPoint is Hashable in modern SDKs).mapBounds == tilemap.framepost-render.Checklist
Request
Please review and merge to improve clarity and reduce potential future naming conflicts. Let me know if you’d prefer the follow-up warning cleanups included here; I kept scope tight for easier diff review.
Thanks!