summaryrefslogtreecommitdiffstats
path: root/tests/nonRegression/bug1491.sci
blob: b469063737fb12df006823aa18ac93a4d7579d23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// <-- Non-regression test for bug 1491 -->
//
// <-- Bugzilla URL -->
// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1491
//
// <-- Short Description -->
//    Bug detected in 3.1.1 under Windows XP.
//    Bug relative to handle Rectangle
//
//    The default value Axes.clip_box is not inherited in Rectangle.clip_box
//
//    Jacques-Deric

// Copyright INRIA
// Scilab Project - Jean-Baptiste Silvy
// Copyright INRIA 2006
// Date : 10/02/2006

clipBox = [0.1,0.9,0.8,0.8] ;

a = gca() ;
a.box        = 'on' ;
// draw the clipping boundaries
xrect( clipBox(1), clipBox(2), clipBox(3), clipBox(4) ) ;
r1 = gce() ;
a.clip_box   = clipBox ;
a.clip_state = 'on' ;

xfrect( 0.0, 0.5, 0.5, 0.5 ) ;
r2 = gce() ;

xpoly([0,1],[0,1]) ;
p1 = gce() ;

checkR1 = ( r1.clip_state == 'off' ) ;
checkR2 = ( r2.clip_state == 'on'  ) & ( r2.clip_box == clipBox ) ;
checkP1 = ( p1.clip_state == 'on'  ) & ( p1.clip_box == clipBox ) ;

// check if the clip_box is set for objects wich are
// created after the axes have been clipped
if ( checkR1 & checkR2 & checkP1  ) then
  affich_result(%T,1491);
else
  affich_result(%F,1491);
end