1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2008-2008 - INRIA - Jean-Baptiste Silvy
4//
5//  This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- TEST WITH GRAPHIC -->
8// <-- Non-regression test for bug 3158 -->
9//
10// <-- Bugzilla URL -->
11// http://bugzilla.scilab.org/show_bug.cgi?id=3158
12//
13// <-- Short Description -->
14// In a 2D plot, when the axes of the figure are in "origin" mode,
15// the zoom works very bad because the (0,0) point remains in the figure.
16a=gca(); a.x_location="origin"; a.y_location="origin";
17x=linspace(0,1,100); plot(x,x)
18// and now make a zoom on a part of the plot not including the (0,0) point
19zoom_rect([0.5,0.5,0.6,0.6]);
20// check that 0 is not included in the frame
21a.margins = [0,0,0,0];
22// get user coordinates of the upper left point of the window
23[x, y] = xchange(0, 0, "i2f");
24if ( abs(x - 0.5) > 0.02 | abs(y - 0.6) > 0.02) then bugmes();quit;end
25