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
10 #include "artisan/gviewport/LineObject.h"
11 #include "artisan/gviewport/CoordinateMapper.h"
13 #include "util/MessageSystem.h"
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 CoordinateMapper
mapper(image
);
29 image
.painter().drawLine(
30 mapper
.dataToPixel(m_from
).toQPoint(),
31 mapper
.dataToPixel(m_to
).toQPoint()
35 } // namespace GViewport
36 } // namespace Artisan