2
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; version 2 of the
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20
#include "tut_stdafx.h"
23
#include <mdc_canvas_view_image.h>
26
using namespace MySQL::Geometry;
28
BEGIN_TEST_DATA_CLASS(canvas_view)
33
TEST_MODULE(canvas_view, "Canvas: view");
38
ImageCanvasView view(500, 400);
42
view.set_page_size(Size(500, 400));
44
ensure_equals("viewport for size=viewport", view.get_viewport().str(), Rect(0, 0, 500, 400).str());
48
ensure_equals("viewport for zoom 2", view.get_viewport().str(), Rect(0, 0, 250, 200).str());
52
ensure_equals("viewport for zoom 0.5", view.get_viewport().str(), Rect(0, 0, 500, 400).str());