summaryrefslogtreecommitdiffstats
path: root/scilab/modules/graphics
diff options
context:
space:
mode:
authorAllan CORNET <allan.cornet@scilab.org>2010-03-30 11:35:22 +0200
committerAllan CORNET <allan.cornet@scilab.org>2010-03-30 11:35:22 +0200
commit42a5f61faed9cc77d966144a7e553468f810aba8 (patch)
treefdcd6beac454d2a4c792509a50705d1d0a879582 /scilab/modules/graphics
parentacdaed72988b395486aa08b379c8fa4ea565e84a (diff)
parent8d24838f4eb83c4722f634abddbeab418b0e77a9 (diff)
downloadscilab-42a5f61faed9cc77d966144a7e553468f810aba8.zip
scilab-42a5f61faed9cc77d966144a7e553468f810aba8.tar.gz
Merge remote branch 'refs/remotes/origin/5.2'
Diffstat (limited to 'scilab/modules/graphics')
-rw-r--r--scilab/modules/graphics/help/en_US/rotate.xml10
-rw-r--r--scilab/modules/graphics/help/fr_FR/rotate.xml6
-rw-r--r--scilab/modules/graphics/sci_gateway/c/sci_Legend.c27
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_6720.dia.ref24
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_6720.tst31
5 files changed, 79 insertions, 19 deletions
diff --git a/scilab/modules/graphics/help/en_US/rotate.xml b/scilab/modules/graphics/help/en_US/rotate.xml
index 08fdfd9..fcf3047 100644
--- a/scilab/modules/graphics/help/en_US/rotate.xml
+++ b/scilab/modules/graphics/help/en_US/rotate.xml
@@ -28,25 +28,25 @@
28 <varlistentry> 28 <varlistentry>
29 <term>xy</term> 29 <term>xy</term>
30 <listitem> 30 <listitem>
31 <para>matrice of size (2,.).</para> 31 <para>matrix of size (2,.).</para>
32 </listitem> 32 </listitem>
33 </varlistentry> 33 </varlistentry>
34 <varlistentry> 34 <varlistentry>
35 <term>xy1</term> 35 <term>xy1</term>
36 <listitem> 36 <listitem>
37 <para>matrice of size (2,.).</para> 37 <para>matrix of size (2,.).</para>
38 </listitem> 38 </listitem>
39 </varlistentry> 39 </varlistentry>
40 <varlistentry> 40 <varlistentry>
41 <term>theta</term> 41 <term>theta</term>
42 <listitem> 42 <listitem>
43 <para>real, angle en radian; default value is 0.</para> 43 <para>real, angle in radians; default value is 0.</para>
44 </listitem> 44 </listitem>
45 </varlistentry> 45 </varlistentry>
46 <varlistentry> 46 <varlistentry>
47 <term>orig</term> 47 <term>orig</term>
48 <listitem> 48 <listitem>
49 <para>center of the rotation; default value is [0;0].</para> 49 <para>center of the rotation [xc;yc]; default value is [0;0].</para>
50 </listitem> 50 </listitem>
51 </varlistentry> 51 </varlistentry>
52 </variablelist> 52 </variablelist>
@@ -55,7 +55,7 @@
55 <title>Description</title> 55 <title>Description</title>
56 <para><literal>rotate</literal> performs a rotation with angle <literal>theta</literal>:</para> 56 <para><literal>rotate</literal> performs a rotation with angle <literal>theta</literal>:</para>
57 <para> 57 <para>
58 <literal>xy1(:,i) = M(theta) *xy (:,i) + orig</literal> 58 <literal>xy1(:,i) = M(theta) *(xy(:,i) - orig) + orig</literal>
59 </para> 59 </para>
60 <para> 60 <para>
61 where <literal>M</literal> stands for the corresponding rotation matrix.</para> 61 where <literal>M</literal> stands for the corresponding rotation matrix.</para>
diff --git a/scilab/modules/graphics/help/fr_FR/rotate.xml b/scilab/modules/graphics/help/fr_FR/rotate.xml
index 44d935a..d1b83f9 100644
--- a/scilab/modules/graphics/help/fr_FR/rotate.xml
+++ b/scilab/modules/graphics/help/fr_FR/rotate.xml
@@ -31,14 +31,14 @@
31 <varlistentry> 31 <varlistentry>
32 <term>theta </term> 32 <term>theta </term>
33 <listitem> 33 <listitem>
34 <para>réel, angle en radian (0 par défaut). 34 <para>réel, angle en radians (0 par défaut).
35</para> 35</para>
36 </listitem> 36 </listitem>
37 </varlistentry> 37 </varlistentry>
38 <varlistentry> 38 <varlistentry>
39 <term>orig </term> 39 <term>orig </term>
40 <listitem> 40 <listitem>
41 <para>centre de la rotation ([0;0] par défaut) 41 <para>centre de la rotation [xc;yc] ([0;0] par défaut)
42</para> 42</para>
43 </listitem> 43 </listitem>
44 </varlistentry> 44 </varlistentry>
@@ -49,7 +49,7 @@
49 <para><literal>rotate</literal> effectue une rotation d'angle theta <literal>theta</literal> : 49 <para><literal>rotate</literal> effectue une rotation d'angle theta <literal>theta</literal> :
50 </para> 50 </para>
51 <para> 51 <para>
52 <literal>xy1(:,i) = M(theta) *xy (:,i) + yesg</literal> 52 <literal>xy1(:,i) = M(theta) *(xy(:,i) - orig) + orig</literal>
53 </para> 53 </para>
54 <para> 54 <para>
55 où <literal>M</literal> représente la matrice de rotation correspondante. 55 où <literal>M</literal> représente la matrice de rotation correspondante.
diff --git a/scilab/modules/graphics/sci_gateway/c/sci_Legend.c b/scilab/modules/graphics/sci_gateway/c/sci_Legend.c
index 99b3947..d91dcad 100644
--- a/scilab/modules/graphics/sci_gateway/c/sci_Legend.c
+++ b/scilab/modules/graphics/sci_gateway/c/sci_Legend.c
@@ -92,26 +92,31 @@ int sci_Legend( char * fname, unsigned long fname_len )
92 Scierror(999,_("%s: No more memory.\n"),fname); 92 Scierror(999,_("%s: No more memory.\n"),fname);
93 return 0; 93 return 0;
94 } 94 }
95
96 startGraphicDataWriting();
97 pFigure = sciGetCurrentFigure();
98 psubwin = sciGetCurrentSubWin();
99 endGraphicDataWriting();
100
101 95
102 for (i = 0; i < n;i++) 96 for (i = 0; i < n;i++)
103 { 97 {
104 handelsvalue = (unsigned long) (hstk(l1))[n-1-i]; 98 handelsvalue = (unsigned long) (hstk(l1))[n-1-i];
99 pobj = sciGetPointerFromHandle(handelsvalue);
105 100
106 if (psubwin!=sciGetParentSubwin( sciGetPointerFromHandle(handelsvalue) )) 101 /**
107 { 102 We get the current pSubwin & pFigure from the first handel's parents.
103 **/
104 if (i==0) {
105 psubwin = sciGetParentSubwin( pobj );
106 pFigure = sciGetParentFigure( pobj );
107 }
108
109 /**
110 We check that the pSubwin is the same for all given handle.
111 **/
112 if (psubwin!=sciGetParentSubwin(pobj))
113 {
108 Scierror(999,_("%s: Objects must have the same axes.\n"),fname); 114 Scierror(999,_("%s: Objects must have the same axes.\n"),fname);
109 return 0; 115 return 0;
110 } 116 }
111 117
112 pobj = sciGetPointerFromHandle(handelsvalue);
113 if (pobj == NULL) 118 if (pobj == NULL)
114 { 119 {
115 freeArrayOfString(Str,n); 120 freeArrayOfString(Str,n);
116 FREE(tabofhandles); 121 FREE(tabofhandles);
117 Scierror(999,_("%s: The handle is no more valid.\n"),fname); 122 Scierror(999,_("%s: The handle is no more valid.\n"),fname);
@@ -119,7 +124,7 @@ int sci_Legend( char * fname, unsigned long fname_len )
119 } 124 }
120 type=sciGetEntityType(pobj); 125 type=sciGetEntityType(pobj);
121 if (type != SCI_POLYLINE) 126 if (type != SCI_POLYLINE)
122 { 127 {
123 freeArrayOfString(Str,n); 128 freeArrayOfString(Str,n);
124 FREE(tabofhandles); 129 FREE(tabofhandles);
125 Scierror(999,_("%s: The %d th handle is not a polyline handle.\n"),fname,i+1); 130 Scierror(999,_("%s: The %d th handle is not a polyline handle.\n"),fname,i+1);
diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_6720.dia.ref b/scilab/modules/graphics/tests/nonreg_tests/bug_6720.dia.ref
new file mode 100644
index 0000000..4c31653
--- /dev/null
+++ b/scilab/modules/graphics/tests/nonreg_tests/bug_6720.dia.ref
@@ -0,0 +1,24 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2006-2010 - DIGITEO - pierre.lando@scilab.org
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 6720 -->
9//
10// <-- Bugzilla URL -->
11// http://bugzilla.scilab.org/show_bug.cgi?id=6720
12//
13// <-- Short Description -->
14// For 'caption' function, scilab checked that
15// "all given handles was children of the current axes"
16// instead of checking that
17// "all given handles have the same parent axes".
18// The script below should now work.
19subplot(211);plot(1:10);h1=gce();
20subplot(212);plot(1:10);h2=gce();
21j1=h1.children;
22j2=h2.children;
23captions(j2,'two');
24captions(j1,'one');
diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_6720.tst b/scilab/modules/graphics/tests/nonreg_tests/bug_6720.tst
new file mode 100644
index 0000000..f3d4ba1
--- /dev/null
+++ b/scilab/modules/graphics/tests/nonreg_tests/bug_6720.tst
@@ -0,0 +1,31 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2006-2010 - DIGITEO - pierre.lando@scilab.org
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7
8// <-- TEST WITH GRAPHIC -->
9
10// <-- Non-regression test for bug 6720 -->
11//
12// <-- Bugzilla URL -->
13// http://bugzilla.scilab.org/show_bug.cgi?id=6720
14//
15// <-- Short Description -->
16// For 'caption' function, scilab checked that
17// "all given handles was children of the current axes"
18// instead of checking that
19// "all given handles have the same parent axes".
20
21// The script below should now work.
22
23subplot(211);plot(1:10);h1=gce();
24subplot(212);plot(1:10);h2=gce();
25
26j1=h1.children;
27j2=h2.children;
28
29captions(j2,'two');
30captions(j1,'one');
31