void KisZoomAndPanTest::testZoomOnBorderZoomLevels()
{
    ZoomAndPanTester t;
    initializeViewport(t, false, false, false);

    QPoint widgetPoint(100,100);

    // test min zoom level
    t.zoomController()->setZoom(KoZoomMode::ZOOM_CONSTANT, KoZoomMode::minimumZoom());
    QVERIFY(checkZoomWithWheel(t, QPoint(100,100), 0.5, true));
    QVERIFY(checkZoomWithAction(t, KoZoomMode::minimumZoom() * 0.5, true));

    // test max zoom level
    t.zoomController()->setZoom(KoZoomMode::ZOOM_CONSTANT, KoZoomMode::maximumZoom());
    QVERIFY(checkZoomWithWheel(t, QPoint(100,100), 2.0, true));
    QVERIFY(checkZoomWithAction(t, KoZoomMode::maximumZoom() * 2.0, true));
}
void KisZoomAndPanTest::testSequentialWheelZoomAndPan(bool fullscreenMode, bool rotate, bool mirror)
{
    ZoomAndPanTester t;
    initializeViewport(t, fullscreenMode, rotate, mirror);

    QVERIFY(checkZoomWithWheel(t, QPoint(100,100), 0.5));
    QVERIFY(checkPan(t, QPoint(100,100)));

    QVERIFY(checkZoomWithWheel(t, QPoint(100,100), 0.5));
    QVERIFY(checkPan(t, QPoint(-100,-100)));

    QVERIFY(checkZoomWithWheel(t, QPoint(100,100), 1.25));
    QVERIFY(checkPan(t, QPoint(100,100)));

    QVERIFY(checkZoomWithWheel(t, QPoint(100,100), 1.5));
    QVERIFY(checkPan(t, QPoint(100,100)));

    QVERIFY(checkZoomWithWheel(t, QPoint(100,100), 2.5));
    QVERIFY(checkPan(t, QPoint(-100,-100)));

    // check one point which is outside the widget
    QVERIFY(checkZoomWithWheel(t, QPoint(-100,100), 2.5));
    QVERIFY(checkPan(t, QPoint(-100,-100)));

    QVERIFY(checkZoomWithWheel(t, QPoint(100,100), 0.5));
    QVERIFY(checkPan(t, QPoint(-100,-100)));
}
Exemplo n.º 3
0
void KisZoomAndPanTest::testZoomOnBorderZoomLevels()
{
    ZoomAndPanTester t;
    initializeViewport(t, false, false, false);

    QPoint widgetPoint(100,100);

    warnKrita << "WARNING: testZoomOnBorderZoomLevels() is disabled due to some changes in KoZoomMode::minimum/maximumZoom()";
    return;

    // test min zoom level
    t.zoomController()->setZoom(KoZoomMode::ZOOM_CONSTANT, KoZoomMode::minimumZoom());
    QVERIFY(checkZoomWithWheel(t, QPoint(100,100), 0.5, true));
    QVERIFY(checkZoomWithAction(t, KoZoomMode::minimumZoom() * 0.5, true));

    // test max zoom level
    t.zoomController()->setZoom(KoZoomMode::ZOOM_CONSTANT, KoZoomMode::maximumZoom());
    QVERIFY(checkZoomWithWheel(t, QPoint(100,100), 2.0, true));
    QVERIFY(checkZoomWithAction(t, KoZoomMode::maximumZoom() * 2.0, true));
}