From 013a76b71b8f1a6492fd9ca0976a46c79557ddf2 Mon Sep 17 00:00:00 2001 From: Calixte DENIZET Date: Mon, 28 Apr 2014 14:25:30 +0200 Subject: [PATCH] Bug 13365 fixed: Data bounds not correctly updated in 3D Change-Id: I9c13d357f5bb8c4e43c3d6e39eb9a3489ad62c38 --- scilab/CHANGES_5.5.X | 2 ++ scilab/modules/graphics/src/c/sciCall.c | 2 +- .../graphics/tests/nonreg_tests/bug_13365.dia.ref | 19 ++++++++++++++++ .../graphics/tests/nonreg_tests/bug_13365.tst | 23 ++++++++++++++++++++ 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 scilab/modules/graphics/tests/nonreg_tests/bug_13365.dia.ref create mode 100644 scilab/modules/graphics/tests/nonreg_tests/bug_13365.tst diff --git a/scilab/CHANGES_5.5.X b/scilab/CHANGES_5.5.X index 905f766..d9db55a 100644 --- a/scilab/CHANGES_5.5.X +++ b/scilab/CHANGES_5.5.X @@ -49,6 +49,8 @@ Scilab Bug Fixes * Bug #13351 fixed - xstringb failed with LaTeX code. +* Bug #13365 fixed - Data bounds werenot correctly updated in 3-D. + * Bug #13378 fixed - The "Console" handle display was not homogeneous with others. * Bug #13381 fixed - eigs was failing when using a function as first input argument. diff --git a/scilab/modules/graphics/src/c/sciCall.c b/scilab/modules/graphics/src/c/sciCall.c index 759df01..fc54e11 100644 --- a/scilab/modules/graphics/src/c/sciCall.c +++ b/scilab/modules/graphics/src/c/sciCall.c @@ -990,7 +990,7 @@ static void updateXYZDataBounds(int iSubwinUID, double rect[6]) int * piFirstPlot = &firstPlot; getGraphicObjectProperty(iSubwinUID, __GO_FIRST_PLOT__, jni_bool, (void **)&piFirstPlot); - if (firstPlot != 0) + if (!firstPlot) { double * dataBounds = NULL; getGraphicObjectProperty(iSubwinUID, __GO_DATA_BOUNDS__, jni_double_vector, (void **)&dataBounds); diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_13365.dia.ref b/scilab/modules/graphics/tests/nonreg_tests/bug_13365.dia.ref new file mode 100644 index 0000000..90f8d7e --- /dev/null +++ b/scilab/modules/graphics/tests/nonreg_tests/bug_13365.dia.ref @@ -0,0 +1,19 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2014 - Scilab Enterprises - Calixte DENIZET +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// <-- TEST WITH GRAPHIC --> +// <-- Non-regression test for bug 13365 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/13365 +// +// <-- Short Description --> +// Data bounds not correctly updated in 3D +scf(); +param3d([0,1], [0,1], [0,1]); +xsegs([2;3], [2;3], [2;3], 5); +a=gca(); +assert_checkequal(a.data_bounds, [0 0 0; 3 3 3]); diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_13365.tst b/scilab/modules/graphics/tests/nonreg_tests/bug_13365.tst new file mode 100644 index 0000000..65b2a2d --- /dev/null +++ b/scilab/modules/graphics/tests/nonreg_tests/bug_13365.tst @@ -0,0 +1,23 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2014 - Scilab Enterprises - Calixte DENIZET +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= + +// <-- TEST WITH GRAPHIC --> + +// <-- Non-regression test for bug 13365 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/13365 +// +// <-- Short Description --> +// Data bounds not correctly updated in 3D + +scf(); +param3d([0,1], [0,1], [0,1]); +xsegs([2;3], [2;3], [2;3], 5); +a=gca(); + +assert_checkequal(a.data_bounds, [0 0 0; 3 3 3]); \ No newline at end of file -- 1.7.9.5