mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-13 14:07:01 -04:00
Fix wxGTK warnings about GetScrollPos on window without scrollbar
This commit is contained in:
@@ -146,7 +146,8 @@ Rotation CardViewer::getRotation() const {
|
|||||||
// Same as DataViewer::getRotation, only taking into account scrolling
|
// Same as DataViewer::getRotation, only taking into account scrolling
|
||||||
if (!stylesheet) stylesheet = set->stylesheet;
|
if (!stylesheet) stylesheet = set->stylesheet;
|
||||||
StyleSheetSettings& ss = settings.stylesheetSettingsFor(*stylesheet);
|
StyleSheetSettings& ss = settings.stylesheetSettingsFor(*stylesheet);
|
||||||
int dx = GetScrollPos(wxHORIZONTAL), dy = GetScrollPos(wxVERTICAL);
|
int dx = CanScroll(wxHORIZONTAL) ? GetScrollPos(wxHORIZONTAL) : 0;
|
||||||
|
int dy = CanScroll(wxVERTICAL) ? GetScrollPos(wxVERTICAL) : 0;
|
||||||
return Rotation(deg_to_rad(ss.card_angle()), stylesheet->getCardRect().move(-dx,-dy,0,0), ss.card_zoom(), 1.0, ROTATION_ATTACH_TOP_LEFT);
|
return Rotation(deg_to_rad(ss.card_angle()), stylesheet->getCardRect().move(-dx,-dy,0,0), ss.card_zoom(), 1.0, ROTATION_ATTACH_TOP_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ NativeLookEditor::NativeLookEditor(Window* parent, int id, long style)
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
Rotation NativeLookEditor::getRotation() const {
|
Rotation NativeLookEditor::getRotation() const {
|
||||||
int dx = GetScrollPos(wxHORIZONTAL), dy = GetScrollPos(wxVERTICAL);
|
int dx = CanScroll(wxHORIZONTAL) ? GetScrollPos(wxHORIZONTAL) : 0;
|
||||||
|
int dy = CanScroll(wxVERTICAL) ? GetScrollPos(wxVERTICAL) : 0;
|
||||||
return Rotation(0, RealRect(RealPoint(-dx,-dy),GetClientSize()));
|
return Rotation(0, RealRect(RealPoint(-dx,-dy),GetClientSize()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,7 +91,9 @@ void NativeLookEditor::resizeViewers() {
|
|||||||
}
|
}
|
||||||
y = y - vspace + margin;
|
y = y - vspace + margin;
|
||||||
SetVirtualSize(w, (int)y);
|
SetVirtualSize(w, (int)y);
|
||||||
SetScrollbar(wxVERTICAL, 0, h, (int)y);
|
if (CanScroll(wxVERTICAL)) {
|
||||||
|
SetScrollbar(wxVERTICAL, 0, h, (int)y);
|
||||||
|
}
|
||||||
if (y >= h) {
|
if (y >= h) {
|
||||||
// Doesn't fit vertically, add scrollbar and resize
|
// Doesn't fit vertically, add scrollbar and resize
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user