mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
New rotation system (see forum thread).
Major changes: - when rotating, the top left corner of the rectangle stays in place. - ValueViewers get a dc that is pre-rotated/translated for them, i.e. (0,0) is the top-left of the viewer (with ValueViewer::getRotation). - moved 'angle' from individual Styles to the Style base class. - any rotation angle is now possible. angle is still an int for now. This warrants a version bump git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@782 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -32,20 +32,24 @@ void ValueViewer::setValue(const ValueP& value) {
|
||||
}
|
||||
|
||||
bool ValueViewer::containsPoint(const RealPoint& p) const {
|
||||
return p.x >= styleP->left
|
||||
&& p.y >= styleP->top
|
||||
&& p.x < styleP->left + (int)(styleP->width)
|
||||
&& p.y < styleP->top + (int)(styleP->height);
|
||||
return p.x >= 0
|
||||
&& p.y >= 0
|
||||
&& p.x < styleP->width
|
||||
&& p.y < styleP->height;
|
||||
}
|
||||
RealRect ValueViewer::boundingBox() const {
|
||||
return styleP->getRect().grow(1);
|
||||
return styleP->getExternalRect().grow(1);
|
||||
}
|
||||
|
||||
Rotation ValueViewer::getRotation() const {
|
||||
return Rotation(getStyle()->angle, getStyle()->getExternalRect(), 1.0, getStretch());
|
||||
}
|
||||
|
||||
void ValueViewer::drawFieldBorder(RotatedDC& dc) {
|
||||
if (viewer.drawBorders() && getField()->editable) {
|
||||
dc.SetPen(viewer.borderPen(isCurrent()));
|
||||
dc.SetBrush(*wxTRANSPARENT_BRUSH);
|
||||
dc.DrawRectangle(styleP->getRect().grow(dc.trInvS(1)));
|
||||
dc.DrawRectangle(dc.getInternalRect().grow(dc.trInvS(1)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user