1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-13 01:03:07 +00:00

Make the preview of the gradient dialog be more accurate with the result

Basically just pixelate the UVs to the canvas size.
This commit is contained in:
Emmanouil Papadeas 2025-02-10 21:01:22 +02:00
parent 93bbdb7c7b
commit 3fa0110614

View file

@ -69,9 +69,9 @@ float dither(vec2 uv, float modified_uv, ivec2 image_size) {
void fragment() {
vec4 original_color = texture(TEXTURE, UV);
vec4 selection_color = texture(selection, UV);
//vec2 tex_size = 1.0 / TEXTURE_PIXEL_SIZE;
//vec2 uv = floor(UV * tex_size) / (tex_size - 1.0);
float modified_uv = modify_uv(UV);
vec2 tex_size = 1.0 / TEXTURE_PIXEL_SIZE;
vec2 uv = floor(UV * tex_size) / (tex_size - 1.0);
float modified_uv = modify_uv(uv);
if (repeat == 1)
modified_uv = fract(modified_uv);
else if (repeat == 2)
@ -92,7 +92,7 @@ void fragment() {
}
continue;
}
if (modified_uv > off) {
if (modified_uv >= off) {
if (i == n_of_colors) {
output = second;
}