Improve 2d snapping

Partially revert change allowing sprite get_rect snapping to be controlled by `pixel_snap` again rather than `transform_snap` (to prevent breaking compatibility). Adds a final `use_camera_snap` project setting to allow snapping viewports as in reduz original PR.
This commit is contained in:
lawnjelly
2020-12-25 18:53:00 +00:00
parent 626ca08108
commit a237c671bb
4 changed files with 19 additions and 4 deletions

View File

@ -60,6 +60,7 @@ private:
float _time_scale;
bool _pixel_snap;
bool _snap_2d_transforms;
bool _snap_2d_viewports;
uint64_t _physics_frames;
float _physics_interpolation_fraction;
@ -109,6 +110,7 @@ public:
_FORCE_INLINE_ bool get_use_pixel_snap() const { return _pixel_snap; }
bool get_snap_2d_transforms() const { return _snap_2d_transforms; }
bool get_snap_2d_viewports() const { return _snap_2d_viewports; }
#ifdef TOOLS_ENABLED
_FORCE_INLINE_ void set_editor_hint(bool p_enabled) { editor_hint = p_enabled; }