Subversion Repositories Kolibri OS

Rev

Rev 7259 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7259 Rev 7271
Line 51... Line 51...
51
		}
51
		}
52
		if (mouse.up) {
52
		if (mouse.up) {
53
			if ((figTool.startX >= 0) 
53
			if ((figTool.startX >= 0) 
54
			&& (figTool.startY >= 0)) {
54
			&& (figTool.startY >= 0)) {
Line 55... Line 55...
55
 
55
 
56
				x1 = figTool.startX - canvas.x/zoom.value;
56
				x1 = TO_CANVAS_X(figTool.startX);
57
				y1 = figTool.startY - canvas.y/zoom.value;
57
				y1 = TO_CANVAS_Y(figTool.startY);
58
				x2 = mouseX - canvas.x/zoom.value;
58
				x2 = TO_CANVAS_X(mouseX);
Line 59... Line 59...
59
				y2 = mouseY - canvas.y/zoom.value;
59
				y2 = TO_CANVAS_Y(mouseY);
60
 
60
 
61
				// Draw line from start position to current position
61
				// Draw line from start position to current position
62
				if (currentTool == TOOL_LINE) {
62
				if (currentTool == TOOL_LINE) {
Line 86... Line 86...
86
void SimpleFigureTool_onCanvasDraw() {
86
void SimpleFigureTool_onCanvasDraw() {
87
	int x1, y1, x2, y2;
87
	int x1, y1, x2, y2;
88
 	if ((figTool.startX >= 0) 
88
 	if ((figTool.startX >= 0) 
89
	&& (figTool.startY >= 0) && (mouse.key)) {
89
	&& (figTool.startY >= 0) && (mouse.key)) {
Line 90... Line 90...
90
 
90
 
91
		x1 = figTool.startX - canvas.x/zoom.value;
91
		x1 = TO_CANVAS_X(figTool.startX);
92
		y1 = figTool.startY - canvas.y/zoom.value;
92
		y1 = TO_CANVAS_Y(figTool.startY);
93
		x2 = mouseX_last - canvas.x/zoom.value;
93
		x2 = TO_CANVAS_X(mouseX_last);
Line 94... Line 94...
94
		y2 = mouseY_last - canvas.y/zoom.value;
94
		y2 = TO_CANVAS_Y(mouseY_last);
95
 
95
 
96
		if (currentTool == TOOL_LINE)
96
		if (currentTool == TOOL_LINE)
97
			DrawLineIcon(x1, y1, x2, y2, tool_color, TOCANVAS);
97
			DrawLineIcon(x1, y1, x2, y2, tool_color, TOCANVAS);