Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
97b648aa
Commit
97b648aa
authored
Sep 13, 2021
by
Whitfield, Ross
Browse files
Get working for Shape2DRectangle
parent
71a293c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
qt/widgets/instrumentview/src/Shape2D.cpp
View file @
97b648aa
...
...
@@ -392,13 +392,19 @@ bool Shape2DRectangle::selectAt(const QPointF &p) const {
}
void
Shape2DRectangle
::
drawShape
(
QPainter
&
painter
)
const
{
QRectF
drawRect
=
m_boundingRect
.
toQRectF
();
auto
center
=
m_boundingRect
.
center
();
QRectF
drawRect
=
m_boundingRect
.
translated
(
-
center
).
toQRectF
();
painter
.
save
();
double
rotation
=
20
;
painter
.
rotate
(
rotation
);
painter
.
translate
(
QTransform
().
rotate
(
-
rotation
).
map
(
center
));
painter
.
drawRect
(
drawRect
);
if
(
m_fill_color
!=
QColor
())
{
QPainterPath
path
;
path
.
addRect
(
drawRect
);
painter
.
fillPath
(
path
,
m_fill_color
);
}
painter
.
restore
();
}
void
Shape2DRectangle
::
addToPath
(
QPainterPath
&
path
)
const
{
path
.
addRect
(
m_boundingRect
.
toQRectF
());
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment