131 float2 co = v_out.co_interp;
135 float2 pos1, pos2, size, center, pos;
141 srt.context_data.round_radius,
152 float outline_width = selected ? 2.0f : 1.0f;
158 float sdf_inner = sdf;
160 float handle_width =
strip.handle_width;
163 pos1.
x += handle_width;
166 pos2.
x -= handle_width;
169 pos1.
y += srt.context_data.pixelsize * outline_width;
170 pos2.
y -= srt.context_data.pixelsize * outline_width;
172 size = (pos2 - pos1) * 0.5f;
173 center = (pos1 + pos2) * 0.5f;
184 if (co.
x <
strip.content_start || co.
x >
strip.content_end) {
192 if (co.
y <
strip.strip_content_top) {
194 (co.
x >=
strip.content_start && co.
x <=
strip.content_end))
203 if (co.
y <
strip.strip_content_top) {
206 if (co.
y >
strip.strip_content_top - 1.0f) {
214 if (co.
x >=
strip.content_start && co.
x <=
strip.content_end && co.
y <
strip.strip_content_top)
216 float diag_y =
strip.strip_content_top - (
strip.strip_content_top -
strip.bottom) *
217 (co.
x -
strip.content_start) /
219 uint transition_color = co.
y <= diag_y ?
strip.col_transition_in :
strip.col_transition_out;
230 if (co.
y >
strip.strip_content_top) {
235 if (co.
y <=
strip.strip_content_top) {
242 if (co.
y <=
strip.strip_content_top) {
243 float phase =
mod(frag_co.x + frag_co.y, 12.0f);
258 bool left_side = pos.
x < center.
x;
260 bool selected_handle = (
strip.flags & handle_flag) != 0;
262 if (sdf <= 0.0f && sdf_inner >= 0.0f) {
263 float4 hcol = selected_handle ? col_outline :
float4(0, 0, 0, 0.2f);
264 hcol.a *=
clamp(sdf_inner, 0.0f, 1.0f);
269 if (!selected_handle) {
284 col = srt.add_outline(sdf, 1.0f, 3.0f, col, col_outline);
286 float d =
max(sdf_inner - 3.0f * srt.context_data.pixelsize, sdf);
287 col = srt.add_outline(d, 3.0f, 4.0f, col,
float4(0, 0, 0, 0.33f));
292 if (active_strip && !selected) {
293 col = srt.add_outline(sdf, 1.0f, 2.0f, col, col_outline);
299 if (overlaps || clamped) {
300 col = srt.add_outline(sdf, 1.0f, 3.0f, col, col_outline);
304 col = srt.add_outline(sdf, 0.0f, 1.0f, col,
unpackUnorm4x8(srt.context_data.col_back));
307 frag_out.color = col;