Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
b8928808
Commit
b8928808
authored
Jun 30, 2011
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linux compilation fix
parent
d515d0e5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
11 deletions
+34
-11
UBAbstractDrawRuler.cpp
src/tools/UBAbstractDrawRuler.cpp
+9
-0
UBAbstractDrawRuler.h
src/tools/UBAbstractDrawRuler.h
+7
-7
UBGraphicsRuler.cpp
src/tools/UBGraphicsRuler.cpp
+1
-1
UBGraphicsTriangle.cpp
src/tools/UBGraphicsTriangle.cpp
+13
-3
UBGraphicsTriangle.h
src/tools/UBGraphicsTriangle.h
+4
-0
No files found.
src/tools/UBAbstractDrawRuler.cpp
View file @
b8928808
...
...
@@ -18,6 +18,15 @@ const QColor UBAbstractDrawRuler::sDarkBackgroundMiddleFillColor = QColor(0xb5,
const
QColor
UBAbstractDrawRuler
::
sDarkBackgroundEdgeFillColor
=
QColor
(
0xdd
,
0xdd
,
0xdd
,
sFillTransparency
);
const
QColor
UBAbstractDrawRuler
::
sDarkBackgroundDrawColor
=
QColor
(
0xff
,
0xff
,
0xff
,
sDrawTransparency
);
const
int
UBAbstractDrawRuler
::
sLeftEdgeMargin
=
10
;
const
int
UBAbstractDrawRuler
::
sDegreeToQtAngleUnit
=
16
;
const
int
UBAbstractDrawRuler
::
sRotationRadius
=
15
;
const
int
UBAbstractDrawRuler
::
sPixelsPerMillimeter
=
5
;
const
int
UBAbstractDrawRuler
::
sFillTransparency
=
127
;
const
int
UBAbstractDrawRuler
::
sDrawTransparency
=
192
;
const
int
UBAbstractDrawRuler
::
sRoundingRadius
=
sLeftEdgeMargin
/
2
;
UBAbstractDrawRuler
::
UBAbstractDrawRuler
()
:
mShowButtons
(
false
)
,
mAntiScaleRatio
(
1.0
)
...
...
src/tools/UBAbstractDrawRuler.h
View file @
b8928808
...
...
@@ -56,13 +56,13 @@ protected:
static
const
QColor
sDarkBackgroundMiddleFillColor
;
static
const
QColor
sDarkBackgroundDrawColor
;
static
const
int
sLeftEdgeMargin
=
10
;
static
const
int
sDegreeToQtAngleUnit
=
16
;
static
const
int
sRotationRadius
=
15
;
static
const
int
sPixelsPerMillimeter
=
5
;
static
const
int
sFillTransparency
=
127
;
static
const
int
sDrawTransparency
=
192
;
static
const
int
sRoundingRadius
=
sLeftEdgeMargin
/
2
;
static
const
int
sLeftEdgeMargin
;
static
const
int
sDegreeToQtAngleUnit
;
static
const
int
sRotationRadius
;
static
const
int
sPixelsPerMillimeter
;
static
const
int
sFillTransparency
;
static
const
int
sDrawTransparency
;
static
const
int
sRoundingRadius
;
};
...
...
src/tools/UBGraphicsRuler.cpp
View file @
b8928808
...
...
@@ -17,7 +17,7 @@
#include "core/memcheck.h"
const
QRect
UBGraphicsRuler
::
sDefaultRect
=
QRect
(
0
,
0
,
800
,
96
);
const
QRect
UBGraphicsRuler
::
sDefaultRect
=
QRect
(
0
,
0
,
800
,
96
);
UBGraphicsRuler
::
UBGraphicsRuler
()
...
...
src/tools/UBGraphicsTriangle.cpp
View file @
b8928808
...
...
@@ -20,6 +20,7 @@ UBGraphicsTriangle::UBGraphicsTriangle()
,
mResizing1
(
false
)
,
mResizing2
(
false
)
,
mRotating
(
false
)
,
angle
(
0
)
{
setRect
(
sDefaultRect
,
sDefaultOrientation
);
...
...
@@ -89,7 +90,9 @@ void UBGraphicsTriangle::setOrientation(UBGraphicsTriangleOrientation orientatio
t
.
setMatrix
(
-
1
,
0
,
0
,
0
,
-
1
,
0
,
boundingRect
().
right
(),
boundingRect
().
bottom
(),
1
);
break
;
}
setTransform
(
t
,
true
);
rotateAroundCenter
(
t
);
setTransform
(
t
);
}
UBGraphicsScene
*
UBGraphicsTriangle
::
scene
()
const
...
...
@@ -203,7 +206,7 @@ void UBGraphicsTriangle::paintGraduations(QPainter *painter)
// Check that grad. line inside triangle
qreal
lineY
=
rect
().
bottom
()
-
rect
().
height
()
/
rect
().
width
()
*
(
rect
().
width
()
-
graduationX
);
if
(
lineY
>=
rotationCenter
().
y
()
+
rect
().
height
()
-
graduationHeight
)
if
(
lineY
>=
rotationCenter
().
y
()
-
graduationHeight
)
break
;
painter
->
drawLine
(
QLine
(
graduationX
,
rotationCenter
().
y
(),
graduationX
,
rotationCenter
().
y
()
-
graduationHeight
));
...
...
@@ -233,13 +236,20 @@ void UBGraphicsTriangle::paintGraduations(QPainter *painter)
void
UBGraphicsTriangle
::
rotateAroundCenter
(
qreal
angle
)
{
this
->
angle
=
angle
;
QTransform
transform
;
rotateAroundCenter
(
transform
);
setTransform
(
transform
,
true
);
}
void
UBGraphicsTriangle
::
rotateAroundCenter
(
QTransform
&
transform
)
{
transform
.
translate
(
rotationCenter
().
x
(),
rotationCenter
().
y
());
transform
.
rotate
(
angle
);
transform
.
translate
(
-
rotationCenter
().
x
(),
-
rotationCenter
().
y
());
setTransform
(
transform
,
true
);
}
QPointF
UBGraphicsTriangle
::
rotationCenter
()
const
{
return
QPointF
(
rect
().
x
()
+
sLeftEdgeMargin
,
rect
().
bottom
());
...
...
src/tools/UBGraphicsTriangle.h
View file @
b8928808
...
...
@@ -92,6 +92,10 @@ class UBGraphicsTriangle : public UBAbstractDrawRuler, public QGraphicsPolygonIt
private
:
QTransform
calculateRotationTransform
();
qreal
angle
;
void
rotateAroundCenter
(
QTransform
&
transform
);
bool
mResizing1
;
bool
mResizing2
;
bool
mRotating
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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