-
Notifications
You must be signed in to change notification settings - Fork 1
/
smdpainter.cpp
37 lines (32 loc) · 1006 Bytes
/
smdpainter.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "smdpainter.h"
#include "utils.h"
#include "unitutilities.h"
void SmdPainter::draw(QPainter *painter, Smd *smd)
{
if (smd->roundness() != 0) {
} else {
bool mirror = false;
float rotation = EAGLE_Utils::rotationToDegrees(smd->rot(), &mirror);
painter->translate(smd->x(), smd->y());
painter->rotate(rotation);
painter->drawRect(QRectF(
- (smd->dx() / 2.0),
- (smd->dy() / 2.0),
smd->dx(),
smd->dy()));
painter->rotate(-rotation);
painter->translate(-smd->x(), -smd->y());
}
}
void SmdPainter::drawCream(QPainter *painter, Smd *smd, qreal factor)
{
// TODO implement cream mask factor!!
if (smd->cream() == Smd::Cream_yes)
draw(painter, smd);
}
void SmdPainter::drawStopMask(QPainter *painter, Smd *smd, qreal factor)
{
// TODO implement stop mask factor!!
if (smd->stop() == Smd::Stop_yes)
draw(painter, smd);
}