Minor changes here and there.
[aesalon.git] / src / artisan / gviewport / LineObject.cpp
blobb04e229332f4df0d81d3aba6243a21117e425a7d
1 /** Aesalon, a tool to visualize program behaviour in real time.
2 Copyright (C) 2009-2011, Aesalon development team.
4 Aesalon is distributed under the terms of the GNU GPLv3. See
5 the included file LICENSE for more information.
7 @file src/artisan/gviewport/LineObject.cpp
8 */
10 #include "artisan/gviewport/LineObject.h"
11 #include "artisan/gviewport/CoordinateMapper.h"
13 #include "util/MessageSystem.h"
15 namespace Artisan {
16 namespace GViewport {
18 LineObject::LineObject(const Point &from, const Point &to) : Object(Rect(from, to)), m_from(from), m_to(to) {
22 LineObject::~LineObject() {
26 void LineObject::renderOnto(RenderedImage &image) {
27 image.startPainting();
29 CoordinateMapper mapper(image);
31 image.painter().drawLine(
32 mapper.dataToPixel(m_from).toQPoint(),
33 mapper.dataToPixel(m_to).toQPoint()
36 image.stopPainting();
39 } // namespace GViewport
40 } // namespace Artisan