@@ -1258,6 +1258,10 @@ void ColorPicker::_update_text_value() {
12581258}
12591259
12601260void ColorPicker::_sample_input (const Ref<InputEvent> &p_event) {
1261+ if (!display_old_color) {
1262+ return ;
1263+ }
1264+
12611265 const Ref<InputEventMouseButton> mb = p_event;
12621266 if (mb.is_valid () && mb->is_pressed () && mb->get_button_index () == MouseButton::LEFT) {
12631267 const Rect2 rect_old = Rect2 (Point2 (), Size2 (sample->get_size ().width * 0.5 , sample->get_size ().height * 0.95 ));
@@ -1310,7 +1314,7 @@ void ColorPicker::_sample_draw() {
13101314
13111315 if (color.r > 1 || color.g > 1 || color.b > 1 ) {
13121316 // Draw an indicator to denote that the new color is "overbright" and can't be displayed accurately in the preview.
1313- sample->draw_texture (theme_cache.overbright_indicator , Point2 (uv_edit ->get_size ().width * 0.5 , 0 ));
1317+ sample->draw_texture (theme_cache.overbright_indicator , Point2 (display_old_color ? sample ->get_size ().width * 0.5 : 0 , 0 ));
13141318 }
13151319}
13161320
@@ -2269,17 +2273,10 @@ ColorPicker::ColorPicker() {
22692273 mode_popup->set_item_checked (current_mode, true );
22702274 mode_popup->set_item_checked (MODE_MAX + 1 , true );
22712275 mode_popup->connect (SceneStringName (id_pressed), callable_mp (this , &ColorPicker::_set_mode_popup_value));
2272- VBoxContainer *vbl = memnew (VBoxContainer);
2273- real_vbox->add_child (vbl);
2274-
2275- VBoxContainer *vbr = memnew (VBoxContainer);
2276-
2277- real_vbox->add_child (vbr);
2278- vbr->set_h_size_flags (SIZE_EXPAND_FILL);
22792276
22802277 slider_gc = memnew (GridContainer);
22812278
2282- vbr ->add_child (slider_gc);
2279+ real_vbox ->add_child (slider_gc);
22832280 slider_gc->set_h_size_flags (SIZE_EXPAND_FILL);
22842281 slider_gc->set_columns (3 );
22852282
@@ -2291,7 +2288,7 @@ ColorPicker::ColorPicker() {
22912288
22922289 hex_hbc = memnew (HBoxContainer);
22932290 hex_hbc->set_alignment (ALIGNMENT_BEGIN);
2294- vbr ->add_child (hex_hbc);
2291+ real_vbox ->add_child (hex_hbc);
22952292
22962293 hex_hbc->add_child (memnew (Label (ETR (" Hex" ))));
22972294
0 commit comments