blocker not showing

This commit is contained in:
Sebastian
2026-06-27 03:13:40 +02:00
parent e4b2df21bc
commit b9ad5293bf
5 changed files with 84 additions and 30 deletions
+61 -12
View File
@@ -7,7 +7,7 @@
viewBox="0 0 512 512" viewBox="0 0 512 512"
version="1.1" version="1.1"
id="svg1" id="svg1"
inkscape:export-filename="round-delete.png" inkscape:export-filename="blocker_open.png"
inkscape:export-xdpi="24" inkscape:export-xdpi="24"
inkscape:export-ydpi="24" inkscape:export-ydpi="24"
inkscape:version="1.4.4 (dcaf3e7d9e, 2026-05-05)" inkscape:version="1.4.4 (dcaf3e7d9e, 2026-05-05)"
@@ -35,7 +35,7 @@
inkscape:window-x="2560" inkscape:window-x="2560"
inkscape:window-y="1106" inkscape:window-y="1106"
inkscape:window-maximized="1" inkscape:window-maximized="1"
inkscape:current-layer="layer1"> inkscape:current-layer="g5">
<sodipodi:guide <sodipodi:guide
position="0,256" position="0,256"
orientation="0,1" orientation="0,1"
@@ -52,22 +52,71 @@
<defs <defs
id="defs1" /> id="defs1" />
<g <g
inkscape:label="Layer 1" inkscape:label="Blocker Open"
inkscape:groupmode="layer" inkscape:groupmode="layer"
id="layer1"> id="layer1"
<circle style="display:none">
style="fill:#b4d273;fill-opacity:1" <rect
id="path2" style="fill:#b4d273;fill-opacity:1;fill-rule:evenodd;stroke-width:0.742756"
cx="256" id="rect1"
cy="256" width="282.46313"
r="256" /> height="512"
x="114.76843"
y="0"
ry="141.23157" />
<rect <rect
style="fill:#d6d6d6;fill-opacity:1;fill-rule:evenodd;stroke-width:0.950718" style="fill:#d6d6d6;fill-opacity:1;fill-rule:evenodd;stroke-width:0.950718"
id="rect2" id="rect2"
width="379.43814" width="379.43814"
height="45.092152" height="45.092152"
x="-445.71915" x="-445.71906"
y="233.45386" y="233.45392"
transform="rotate(-90)" /> transform="rotate(-90)" />
<circle
style="fill:#d6d6d6;fill-opacity:1"
id="path1"
cx="255.99994"
cy="106.15759"
r="56.149471" />
<circle
style="fill:#d6d6d6;fill-opacity:1"
id="path1-0"
cx="256"
cy="407.41348"
r="56.149471" />
</g>
<g
inkscape:label="Blocker Closed"
inkscape:groupmode="layer"
id="g5"
transform="rotate(-90,256,256)">
<rect
style="fill:#c35355;fill-opacity:1;fill-rule:evenodd;stroke-width:0.742756"
id="rect3"
width="282.46313"
height="512"
x="114.76843"
y="0"
ry="141.23157" />
<rect
style="fill:#d6d6d6;fill-opacity:1;fill-rule:evenodd;stroke-width:0.950718"
id="rect4"
width="379.43814"
height="45.092152"
x="-445.71906"
y="233.45392"
transform="rotate(-90)" />
<circle
style="fill:#d6d6d6;fill-opacity:1"
id="circle4"
cx="255.99994"
cy="106.15759"
r="56.149471" />
<circle
style="fill:#d6d6d6;fill-opacity:1"
id="circle5"
cx="256"
cy="407.41348"
r="56.149471" />
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

+21 -18
View File
@@ -33,6 +33,8 @@ namespace VISEQ::GRAPH{
void GraphManager::loadTextures(){ void GraphManager::loadTextures(){
tex_delete = LoadTexture("resources/textures/delete.png"); tex_delete = LoadTexture("resources/textures/delete.png");
tex_split = LoadTexture("resources/textures/split.png"); tex_split = LoadTexture("resources/textures/split.png");
tex_blocker_open = LoadTexture("resources/textures/blocker_open.png");
tex_blocker_closed= LoadTexture("resources/textures/blocker_closed.png");
} }
int GraphManager::getNodesSize(){ int GraphManager::getNodesSize(){
@@ -369,11 +371,13 @@ namespace VISEQ::GRAPH{
Vec2Df flip_handle_2 = middle_handle_2 + (v1_position - v2_position).norm().orth() * (v1_v2_distance < 120.0f ? Clamp((120.0f - v1_v2_distance)*-0.2, -20.f, 0.f) : 1.0f); Vec2Df flip_handle_2 = middle_handle_2 + (v1_position - v2_position).norm().orth() * (v1_v2_distance < 120.0f ? Clamp((120.0f - v1_v2_distance)*-0.2, -20.f, 0.f) : 1.0f);
// Dynamic opacity by distance to mouse // Dynamic opacity by distance to mouse
unsigned char opacity = 200.0f; //150.0f - Clamp(middle_handle.dist(mouse_pos), 0.0f, 150.0f); unsigned char opacity = 150.0f - Clamp(center_handle.dist(mouse_pos), 0.0f, 130.0f);
unsigned char opacity_from = 200.0f; //250.0f - Clamp(from_to_handle.dist(mouse_pos), 0.0f, 220.0f); unsigned char opacity_from = 250.0f - Clamp(from_to_handle.dist(mouse_pos), 0.0f, 220.0f);
unsigned char opacity_to = 200.0f; //250.0f - Clamp(to_from_handle.dist(mouse_pos), 0.0f, 220.0f); unsigned char opacity_to = 250.0f - Clamp(to_from_handle.dist(mouse_pos), 0.0f, 220.0f);
float opacity_normalized = 0.80f; //Clamp((float)opacity / 255.0f, .0f, 1.0f); float opacity_normalized = Clamp((float)opacity / 255.0f, .0f, 1.0f);
float opacity_from_normalized = Clamp((float)opacity_from / 255.0f, .0f, 1.0f);
float opacity_to_normalized = Clamp((float)opacity_to / 255.0f, .0f, 1.0f);
// float midi_gate_v1 = 0.0f; // float midi_gate_v1 = 0.0f;
// float midi_gate_v2 = 0.0f; // float midi_gate_v2 = 0.0f;
@@ -414,21 +418,20 @@ namespace VISEQ::GRAPH{
if(!c->start.lock()->picked_up && !c->end.lock()->picked_up){ if(!c->start.lock()->picked_up && !c->end.lock()->picked_up){
// On/Off switches on both sides // On/Off switches on both sides
if(ViButton(mouse_pos, from_to_handle.x, from_to_handle.y, 8.0f, c->pass_forward ? (Color){120, 210, 115, opacity_from} : (Color){232, 50, 32, opacity_from} )) c->pass_forward = !c->pass_forward; Texture2D tex_forward;
if(ViButton(mouse_pos, to_from_handle.x, to_from_handle.y, 8.0f, c->pass_backward ? (Color){120, 210, 115, opacity_to} : (Color){232, 50, 32, opacity_to} )) c->pass_backward = !c->pass_backward; Texture2D tex_backward;
if(!c->pass_forward){ if(c->pass_forward) tex_forward = tex_blocker_open;
Vec2Df block_point1 = (v1_position - v2_position).norm().orth()*4.0f + from_to_handle; if(!c->pass_forward) tex_forward = tex_blocker_closed;
Vec2Df block_point2 = (v1_position - v2_position).norm().orth()*-4.0f + from_to_handle;
DrawLineEx(block_point1, block_point2, 2.0f, (Color){232,232,232,opacity_from});
}
if(!c->pass_backward){ if(c->pass_backward) tex_backward = tex_blocker_open;
Vec2Df block_point1 = (v1_position - v2_position).norm().orth()*4.0f + to_from_handle; if(!c->pass_backward) tex_backward = tex_blocker_closed;
Vec2Df block_point2 = (v1_position - v2_position).norm().orth()*-4.0f + to_from_handle;
DrawLineEx(block_point1, block_point2, 2.0f, (Color){232,232,232,opacity_to});
}
if(IsWindowReady()){ if(IsWindowReady()){
if(ViTexButton(mouse_pos, from_to_handle, HELPER::GetRotation(from_to_handle, to_from_handle), 8.0f, tex_forward, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_from_normalized))) c->pass_forward = !c->pass_forward;
if(ViTexButton(mouse_pos, to_from_handle, HELPER::GetRotation(to_from_handle, from_to_handle), 8.0f, tex_backward, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_to_normalized))) c->pass_backward = !c->pass_backward;
if(ViTexButton(mouse_pos, center_handle, HELPER::GetRotation(from_to_handle, to_from_handle) + 90.0f, 8.0f, tex_split, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_normalized) )) splitEdge(c); if(ViTexButton(mouse_pos, center_handle, HELPER::GetRotation(from_to_handle, to_from_handle) + 90.0f, 8.0f, tex_split, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_normalized) )) splitEdge(c);
} }
} }
@@ -437,8 +440,8 @@ namespace VISEQ::GRAPH{
DrawLine(v1_position.x, v1_position.y, v2_position.x, v2_position.y, VS_COLOR_BLUE); DrawLine(v1_position.x, v1_position.y, v2_position.x, v2_position.y, VS_COLOR_BLUE);
} }
if(IsWindowReady()){ if(IsWindowReady()){
if(ViTexButton(mouse_pos, middle_handle, HELPER::GetRotation(from_to_handle, to_from_handle), 8.0f, tex_delete, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_normalized) )) removeEdge(c); if(ViTexButton(mouse_pos, middle_handle, HELPER::GetRotation(from_to_handle, to_from_handle), 8.0f, tex_delete, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_from_normalized) )) removeEdge(c);
if(ViTexButton(mouse_pos, middle_handle_2, HELPER::GetRotation(from_to_handle, to_from_handle), 8.0f, tex_delete, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_normalized) )) removeEdge(c); if(ViTexButton(mouse_pos, middle_handle_2, HELPER::GetRotation(from_to_handle, to_from_handle), 8.0f, tex_delete, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_to_normalized) )) removeEdge(c);
} }
} }
} }
+2
View File
@@ -88,6 +88,8 @@ namespace VISEQ::GRAPH {
Texture2D tex_delete; Texture2D tex_delete;
Texture2D tex_split; Texture2D tex_split;
Texture2D tex_blocker_open;
Texture2D tex_blocker_closed;
}; };
} }