mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Various tweaks and fixes, mostly to the drop down lists
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@620 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -37,7 +37,7 @@ void ChoiceValueViewer::draw(RotatedDC& dc) {
|
||||
} else {
|
||||
img_options.width = (int) dc.trX(style().width);
|
||||
img_options.height = (int) dc.trY(style().height);
|
||||
img_options.preserve_aspect = style().alignment == ALIGN_STRETCH ? ASPECT_STRETCH : ASPECT_FIT;
|
||||
img_options.preserve_aspect = (style().alignment & ALIGN_STRETCH) ? ASPECT_STRETCH : ASPECT_FIT;
|
||||
}
|
||||
Image image = img.generate(img_options, true);
|
||||
ImageCombine combine = img.combine();
|
||||
|
||||
@@ -70,8 +70,8 @@ void ColorValueViewer::draw(RotatedDC& dc) {
|
||||
|
||||
bool ColorValueViewer::containsPoint(const RealPoint& p) const {
|
||||
// distance to each side
|
||||
double left = p.x - style().left, right = style().left + style().width - p.x - 1;
|
||||
double top = p.y - style().top, bottom = style().top + style().height - p.y - 1;
|
||||
double left = p.x - style().left, right = style().right - p.x - 1;
|
||||
double top = p.y - style().top, bottom = style().bottom - p.y - 1;
|
||||
if (left < 0 || right < 0 || top < 0 || bottom < 0 || // outside bounding box
|
||||
(left >= style().left_width && right >= style().right_width && // outside horizontal border
|
||||
top >= style().top_width && bottom >= style().bottom_width)) { // outside vertical border
|
||||
|
||||
@@ -29,10 +29,12 @@ void TextValueViewer::draw(RotatedDC& dc) {
|
||||
if (!v.prepared()) {
|
||||
v.prepare(dc, value().value(), style(), viewer.getContext());
|
||||
}
|
||||
if (viewer.drawFocus() && isCurrent()) {
|
||||
v.draw(dc, style(), DRAW_ACTIVE);
|
||||
}
|
||||
v.draw(dc, style(), (DrawWhat)(
|
||||
DRAW_NORMAL
|
||||
| (viewer.drawBorders() ? DRAW_BORDERS : 0)
|
||||
| (viewer.drawFocus() && isCurrent() ? DRAW_ACTIVE : 0)
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user