diff options
Diffstat (limited to 'tools/mapedit/src/widget.cpp')
-rw-r--r-- | tools/mapedit/src/widget.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/mapedit/src/widget.cpp b/tools/mapedit/src/widget.cpp index c74b194..aaebd38 100644 --- a/tools/mapedit/src/widget.cpp +++ b/tools/mapedit/src/widget.cpp | |||
@@ -38,17 +38,20 @@ void MapeditWidget::Init() | |||
38 | 38 | ||
39 | this->FitInside(); | 39 | this->FitInside(); |
40 | this->SetScrollRate(5, 5); | 40 | this->SetScrollRate(5, 5); |
41 | 41 | } | |
42 | SetVirtualSize(EDITOR_WIDTH, EDITOR_HEIGHT); | 42 | |
43 | 43 | void MapeditWidget::SetUpZoom(int zoom) | |
44 | int cW, cH; | 44 | { |
45 | int cW, cH, vXX, vXY; | ||
45 | GetClientSize(&cW, &cH); | 46 | GetClientSize(&cW, &cH); |
47 | GetScrollPixelsPerUnit(&vXX, &vXY); | ||
48 | |||
46 | mousePos.x = cW / 2; | 49 | mousePos.x = cW / 2; |
47 | mousePos.y = cH / 2; | 50 | mousePos.y = cH / 2; |
48 | 51 | ||
49 | // Scroll(GAME_WIDTH*1.5-mousePos.x, GAME_HEIGHT*1.5-mousePos.y); | 52 | scale = zoom; |
50 | 53 | SetVirtualSize(EDITOR_WIDTH * scale, EDITOR_HEIGHT * scale); | |
51 | SetZoomSize(2); | 54 | Scroll((EDITOR_WIDTH*scale-cW)/2/vXX, (EDITOR_HEIGHT*scale-cH)/2/vXY); |
52 | } | 55 | } |
53 | 56 | ||
54 | wxSize MapeditWidget::DoGetBestSize() const | 57 | wxSize MapeditWidget::DoGetBestSize() const |