More rectangle functions, more @safe, and default values of Camera2D#57
Open
LiamM32 wants to merge 3 commits intoschveiguy:masterfrom
Open
More rectangle functions, more @safe, and default values of Camera2D#57LiamM32 wants to merge 3 commits intoschveiguy:masterfrom
@safe, and default values of Camera2D#57LiamM32 wants to merge 3 commits intoschveiguy:masterfrom
Conversation
Added more functions to `Rectangle`.
…ges in comments.
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.
These are the changes:
dub.jsonnow says to includeraylib, as Raylib-D isn't usable without it.Rectangle, includingtop,bottom,left, andright.@safe.Camera2D.zoomset to1.0fby default. This would make it easy to figure-out how to use.I think it makes sense for
Camera2D.zoomto be set to1.0fby default, because that is what it is usually set to straight away. The documentation for Raylib even says that it should be set to1.0fby default, which a new D programmer not experienced in C may interpret this to mean that it is set to1.0fby default.Let's just hope that there aren't any projects out there that use the value of
Camera2D.zoomto detect whether a camera has been initialized, as that would result in a breaking change here. However, I think it's unlikely that there are any programs that do that. I considered having an "enhancedD" configuration that would set things to be more D-like while keeping the default configuration to be in-line with Raylib. However, I decided to drop this idea as a new user of Raylib-D probably wouldn't think to set this configuration when starting a new project.