From 243275a0eded4fd8635c7a31b3905d3a03c16564 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 11 Oct 2005 10:45:55 +0000 Subject: [PATCH] set_scale() doesn't necessarily inflate 2d to 3d --- panda/src/pgraph/transformState.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/panda/src/pgraph/transformState.cxx b/panda/src/pgraph/transformState.cxx index 5041f7a86e..c050be748b 100644 --- a/panda/src/pgraph/transformState.cxx +++ b/panda/src/pgraph/transformState.cxx @@ -464,6 +464,15 @@ CPT(TransformState) TransformState:: set_scale(const LVecBase3f &scale) const { nassertr(!scale.is_nan(), this); nassertr(!is_invalid(), this); + + if (is_2d() && scale[0] == scale[1] && scale[1] == scale[2]) { + // Don't inflate from 2-d to 3-d just because we got a uniform + // scale. + return make_pos_rotate_scale_shear2d(get_pos2d(), get_rotate2d(), + LVecBase2f(scale[0], scale[0]), + get_shear2d()); + } + // nassertr(has_components(), this); if (quat_given()) { return make_pos_quat_scale_shear(get_pos(), get_quat(), scale, get_shear());