Skip to content

Commit 0cd049e

Browse files
authored
Merge pull request #62494 from TechnoPorg/gradient-fix-precision
2 parents fed5ebb + d45ad9b commit 0cd049e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

scene/gui/gradient_edit.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ void GradientEdit::_color_changed(const Color &p_color) {
382382
emit_signal(SNAME("ramp_changed"));
383383
}
384384

385-
void GradientEdit::set_ramp(const Vector<real_t> &p_offsets, const Vector<Color> &p_colors) {
385+
void GradientEdit::set_ramp(const Vector<float> &p_offsets, const Vector<Color> &p_colors) {
386386
ERR_FAIL_COND(p_offsets.size() != p_colors.size());
387387
points.clear();
388388
for (int i = 0; i < p_offsets.size(); i++) {
@@ -396,8 +396,8 @@ void GradientEdit::set_ramp(const Vector<real_t> &p_offsets, const Vector<Color>
396396
update();
397397
}
398398

399-
Vector<real_t> GradientEdit::get_offsets() const {
400-
Vector<real_t> ret;
399+
Vector<float> GradientEdit::get_offsets() const {
400+
Vector<float> ret;
401401
for (int i = 0; i < points.size(); i++) {
402402
ret.push_back(points[i].offset);
403403
}

scene/gui/gradient_edit.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ class GradientEdit : public Control {
6767
static void _bind_methods();
6868

6969
public:
70-
void set_ramp(const Vector<real_t> &p_offsets, const Vector<Color> &p_colors);
71-
Vector<real_t> get_offsets() const;
70+
void set_ramp(const Vector<float> &p_offsets, const Vector<Color> &p_colors);
71+
Vector<float> get_offsets() const;
7272
Vector<Color> get_colors() const;
7373
void set_points(Vector<Gradient::Point> &p_points);
7474
Vector<Gradient::Point> &get_points();

0 commit comments

Comments
 (0)