summaryrefslogtreecommitdiff
path: root/scene/gui/range.cpp
AgeCommit message (Collapse)Author
2020-12-28Rename empty() to is_empty()Marcel Admiraal
2020-05-16Update all get_configuration_warning to retrieve warnings from the parentArrowInAKnee
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: Enforce separation line between function definitionsRémi Verschelde
I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
2020-04-02Replace NULL with nullptrlupoDharkael
2020-02-25Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky
- Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
2020-01-01Update copyright statements to 2020Rémi Verschelde
Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
2019-11-26Range: Remove min/max check added in #33908Rémi Verschelde
This wasn't a very good idea as it puts too strict requirements on how to set `min` and `max` values. For example, since the default min and max are 0 and 100, this triggers an error: ``` set_min(256) set_max(16384) ``` Since `min` will be higher than `max` temporarily. It can be worked around by setting max first, but it's not really intuitive. I'll relax the requirement as it's only a problem in `get_as_ratio`, which already has a check. Fix another min == max occurrence.
2019-11-26Range: Fix cases where max was set to or below min valueRémi Verschelde
It will now raise an error whenever this happens so that we can fix these situations. `max == min` is not allowed as it could lead to divisions by zero in ratios, and `max < min` doesn't make much sense. Fixes #33907.
2019-11-20Fix some overflows and unitialized variablesRafał Mikrut
2019-11-10Memory leak and crash fixesRafał Mikrut
2019-08-09Fix Exponential Range Graphical ErrorEmmanuel Barroga
Fixes the Exponential Range Slider having a graphical error with less than 1 values.
2019-07-09Improve the node configuration warning displayHugo Locurcio
- Refer to properties explicitly when possible - When multiple warnings are returned, always separate them by one blank line to make them easier to distinguish - Improve grammar and formatting
2019-06-16Fix Range's "changed" signal emitting with a value even if binded to emit noneMichael Alexsander Silva Dias
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-09-28Merge pull request #22381 from DualMatrix/range_exp_warningRémi Verschelde
Added warning when min_value of range <= 0 while exp_edit is true.
2018-09-24Fixed step value not being respected for ranges in some cases.DualMatrix
Fixed step value not being respected for ranges in some cases.
2018-09-23Added warning when min_value of range is smaller than 0 while exp_edit is true.DualMatrix
Added warning when min_value of range is smaller than 0 while exp_edit is true. The new warning is: "If exp_edit is true min_value must be > 0."
2018-08-16Fix type of Range allow_greater/allow_lesser propertiesRémi Verschelde
2018-05-16Allow editing of some unbound properties when hinted (or no range hinted)Juan Linietsky
2018-05-15-New inspector.Juan Linietsky
-Changed UI resizing code, gained huge amount of speed. -Reorganized timer sync to clean up behavior (sorry forgot commit this before) -
2018-01-12Bind many more properties to scriptsBojidar Marinov
Notable potentially breaking changes: - PROPERTY_USAGE_NOEDITOR is now PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_NETWORK, without PROPERTY_USAGE_INTERNAL - Some properties were renamed, and sometimes even shadowed by new ones - New getter methods (some virtual) were added
2018-01-05Add missing copyright headers and fix formattingRémi Verschelde
Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
2018-01-01Update copyright statements to 2018Rémi Verschelde
Happy new year to the wonderful Godot community!
2017-09-28Fix crash when unsharing a range that is not sharedDylan Enloe
Added a guard to Range::_unref_shared to prevent it from doing anything in the event that shared is null. Fixes Issue: #11521
2017-08-27Use HTTPS URL for Godot's website in the headersRémi Verschelde
2017-08-24Convert Object::cast_to() to the static versionHein-Pieter van Braam
Currently we rely on some undefined behavior when Object->cast_to() gets called with a Null pointer. This used to work fine with GCC < 6 but newer versions of GCC remove all codepaths in which the this pointer is Null. However, the non-static cast_to() was supposed to be null safe. This patch makes cast_to() Null safe and removes the now redundant Null checks where they existed. It is explained in this article: https://www.viva64.com/en/b/0226/
2017-08-10Removes type information from method bindsIgnacio Etcheverry
2017-07-24Merge pull request #9764 from Noshyaar/pr-fix2Rémi Verschelde
Add object type hint for docs
2017-07-23Add object type hint for docsPoommetee Ketson
2017-07-21AnimationTree nodes sliders fixesJakub Grzesik
2017-04-08Add "Godot Engine contributors" copyright lineRémi Verschelde
2017-04-03Fix more property names in _change_notify calls.Andreas Haas
2017-03-05A Whole New World (clang-format edition)Rémi Verschelde
I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
2017-02-13Rename the _MD macro to D_METHODHein-Pieter van Braam
This new name also makes its purpose a little clearer This is a step towards fixing #56
2017-02-13Remove use of _SCS from ADD_METHODHein-Pieter van Braam
This saves typing and is a step towards fixing #56
2017-01-16Overloaded basic math funcs (double and float variants). Use real_t rather ↵Ferenc Arn
than float or double in generic functions (core/math) whenever possible. Also inlined some more math functions.
2017-01-13Renamed button functions to be more verboes, same with Range unit value -> ratioJuan Linietsky
2017-01-04-Conversion of most properties to a simpler syntax, easier to use by scriptJuan Linietsky
-Modified help to display properties GDScript can still not make use of them, though.
2017-01-02ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to ↵Juan Linietsky
Variant. All usages of "type" to refer to classes were renamed to "class" ClassDB has been exposed to GDScript. OBJ_TYPE() macro is now GDCLASS()
2017-01-01Welcome in 2017, dear changelog reader!Rémi Verschelde
That year should bring the long-awaited OpenGL ES 3.0 compatible renderer with state-of-the-art rendering techniques tuned to work as low as middle end handheld devices - without compromising with the possibilities given for higher end desktop games of course. Great times ahead for the Godot community and the gamers that will play our games!
2016-10-15Make the step property useful for sliders as described in #5773Elia Argentieri
2016-05-01math: Fix rounding error for 0 in Math::round (#4495)Rémi Verschelde
Thus revert the previous workaround in commit b123bc4a2a9c07fcfd27a84109960bda158b3b9d. Fixes #3221.
2016-03-09remove trailing whitespaceHubert Jarosz
2016-01-11Merge pull request #3257 from TheHX/pr-range-propertiesRémi Verschelde
Fix error caused by dragging a Range property
2016-01-08do not return zero with minus-sign within range value, fixes #3221Richard Nespithal
2016-01-06Fix error caused by dragging a Range propertyFranklin Sobrinho
2016-01-01Update copyright to 2016 in headersGeorge Marques
2015-12-28Style fix for rounded_values methods in RangeRémi Verschelde