still wrong position
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ inline bool ViButton(Vec2Df mp, float x, float y, float radius, Color color){
|
|||||||
|
|
||||||
inline bool ViTexButton(Vec2Df mp, Vec2Df position, float rotation, float radius, Texture2D tex, Color color){
|
inline bool ViTexButton(Vec2Df mp, Vec2Df position, float rotation, float radius, Texture2D tex, Color color){
|
||||||
float scale = (radius*2.0f) / (float)tex.width;
|
float scale = (radius*2.0f) / (float)tex.width;
|
||||||
Vec2Df center_pos = position - Vec2Df((tex.width*scale) / 2.0f, (tex.height*scale) / 2.0f).rotate(rotation);
|
Vec2Df center_pos = (position + Vec2Df((tex.width*scale) / 2.0f, 0.0f)).orbitAtAngle(radius, -rotation*DEG2RAD); //- Vec2Df(0, (tex.width*scale) / 2.0f).rotate(rotation);
|
||||||
DrawTextureEx(tex, center_pos, rotation, scale, color);
|
DrawTextureEx(tex, center_pos, rotation, scale, color);
|
||||||
|
|
||||||
return (Vector2Distance(mp, position) < radius && IsMouseButtonPressed(MOUSE_BUTTON_LEFT));
|
return (Vector2Distance(mp, position) < radius && IsMouseButtonPressed(MOUSE_BUTTON_LEFT));
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ namespace VISEQ::GRAPH{
|
|||||||
if(c->start.lock()->getNodeType() == NodeType::CONFIGNODE || c->end.lock()->getNodeType() == NodeType::CONFIGNODE){
|
if(c->start.lock()->getNodeType() == NodeType::CONFIGNODE || c->end.lock()->getNodeType() == NodeType::CONFIGNODE){
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
DrawCircleV(flip_handle, 3.0f, VS_COLOR_PINK);
|
||||||
if(IsWindowReady() && ViTexButton(mouse_pos, flip_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(IsWindowReady() && ViTexButton(mouse_pos, flip_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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user