1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-03-13 06:45:17 +00:00

Limit outline width step to 1 and allow lesser/greater values for shader-generated sliders

This commit is contained in:
Emmanouil Papadeas 2023-11-22 17:18:37 +02:00
parent d5c520643b
commit 768869b519
2 changed files with 5 additions and 1 deletions

View file

@ -951,6 +951,8 @@ func create_ui_for_shader_uniforms(
label.text = humanized_u_name label.text = humanized_u_name
label.size_flags_horizontal = Control.SIZE_EXPAND_FILL label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
var slider := ValueSlider.new() var slider := ValueSlider.new()
slider.allow_greater = true
slider.allow_lesser = true
slider.size_flags_horizontal = Control.SIZE_EXPAND_FILL slider.size_flags_horizontal = Control.SIZE_EXPAND_FILL
var min_value := 0.0 var min_value := 0.0
var max_value := 255.0 var max_value := 255.0
@ -1008,6 +1010,8 @@ func create_ui_for_shader_uniforms(
label.size_flags_horizontal = Control.SIZE_EXPAND_FILL label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
var vector2 := _vec2str_to_vector2(u_value) var vector2 := _vec2str_to_vector2(u_value)
var slider := VALUE_SLIDER_V2_TSCN.instantiate() as ValueSliderV2 var slider := VALUE_SLIDER_V2_TSCN.instantiate() as ValueSliderV2
slider.allow_greater = true
slider.allow_lesser = true
slider.size_flags_horizontal = Control.SIZE_EXPAND_FILL slider.size_flags_horizontal = Control.SIZE_EXPAND_FILL
slider.value = vector2 slider.value = vector2
if params.has(u_name): if params.has(u_name):

View file

@ -3,7 +3,7 @@ shader_type canvas_item;
render_mode unshaded; render_mode unshaded;
uniform vec4 color : source_color = vec4(1.0); uniform vec4 color : source_color = vec4(1.0);
uniform float width : hint_range(0, 10) = 1.0; uniform float width : hint_range(0, 10, 1) = 1.0;
uniform int pattern : hint_range(0, 2) = 0; // diamond, circle, square uniform int pattern : hint_range(0, 2) = 0; // diamond, circle, square
uniform bool inside = false; uniform bool inside = false;
uniform sampler2D selection; uniform sampler2D selection;