#include "line.h" line::line(const coordsys& sys, const coordinate& p_1, const coordinate& p_2): drawable(sys),p1(p_1),p2(p_2) { } void line::draw(canvas& C) { coordsys paper(0,0,C.width(),C.height()); coordinate gridp1,gridp2, pr1=p1,pr2=p2; if (rotate) { pr1 = system.rotate(p1,rotation_center,rotation_angle); pr2 = system.rotate(p2,rotation_center,rotation_angle); } gridp1 = paper.map(system,pr1); gridp2 = paper.map(system,pr2); C.draw_line(round(gridp1.x()),round(gridp1.y()), round(gridp2.x()),round(gridp2.y()),pen_color,id); }