diff --git a/aegisub/visual_tool.cpp b/aegisub/visual_tool.cpp index 0dc431b07..cc5133ef6 100644 --- a/aegisub/visual_tool.cpp +++ b/aegisub/visual_tool.cpp @@ -60,9 +60,9 @@ VisualTool::VisualTool(VideoDisplay *par) : eventSink(this) { // Config parent = par; - colour[0] = wxColour(27,60,114); - colour[1] = wxColour(166,247,177); - colour[2] = wxColour(255,255,255); + colour[0] = wxColour(106,32,19); + colour[1] = wxColour(255,169,40); + colour[2] = wxColour(255,253,185); colour[3] = wxColour(187,0,0); // Holding variables @@ -298,8 +298,8 @@ void VisualTool::DrawAllFeatures() { // Draw features for (size_t i=0;ibrother[0]]; + p2 = &features[i]; + p1 = &features[p2->brother[0]]; - // See if the distance between them is at least 30 pixels + // Has arrow? + bool hasArrow = p2->type == DRAG_BIG_CIRCLE; + int arrowLen = hasArrow ? 10 : 0; + + // See if the distance between them is enough int dx = p2->x - p1->x; int dy = p2->y - p1->y; int dist = (int)sqrt(double(dx*dx + dy*dy)); - if (dist < 30) continue; + if (dist < 20+arrowLen) continue; // Get end points int x1 = p1->x + dx*10/dist; - int x2 = p2->x - dx*20/dist; + int x2 = p2->x - dx*(10+arrowLen)/dist; int y1 = p1->y + dy*10/dist; - int y2 = p2->y - dy*20/dist; - - // Draw line - SetLineColour(colour[3],0.8f,2); - DrawLine(x1,y1,x2,y2); + int y2 = p2->y - dy*(10+arrowLen)/dist; // Draw arrow - double angle = atan2(double(y2-y1),double(x2-x1))+1.570796; - int sx = int(cos(angle)*4); - int sy = int(-sin(angle)*4); - DrawLine(x2+sx,y2-sy,x2-sx,y2+sy); - DrawLine(x2+sx,y2-sy,x2+dx*10/dist,y2+dy*10/dist); - DrawLine(x2-sx,y2+sy,x2+dx*10/dist,y2+dy*10/dist); + if (hasArrow) { + // Calculate angle + double angle = atan2(double(y2-y1),double(x2-x1))+1.570796; + int sx = int(cos(angle)*4); + int sy = int(-sin(angle)*4); + + // Arrow line + SetLineColour(colour[3],0.8f,2); + DrawLine(x1,y1,x2,y2); + + // Arrow head + DrawLine(x2+sx,y2-sy,x2-sx,y2+sy); + DrawLine(x2+sx,y2-sy,x2+dx*10/dist,y2+dy*10/dist); + DrawLine(x2-sx,y2+sy,x2+dx*10/dist,y2+dy*10/dist); + } + + // Draw dashed line + else { + SetLineColour(colour[3],0.5f,2); + int steps = (dist-20)/6; + double stepx = double(x2-x1)/steps; + double stepy = double(y2-y1)/steps; + for (int i=0;i