diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2011-07-02 06:11:08 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2011-07-02 06:11:08 +0000 |
| commit | 07c8dea2b0361314ac4bbf0e45dd4c33ce11f206 (patch) | |
| tree | d5452b36543452b5e79e9c7c688c897a6b87dfe8 /src/box3d.cpp | |
| parent | compatibility for building with clang, this failed for 2 reasons. (diff) | |
| download | inkscape-07c8dea2b0361314ac4bbf0e45dd4c33ce11f206.tar.gz inkscape-07c8dea2b0361314ac4bbf0e45dd4c33ce11f206.zip | |
Applying patch from Campbell Barton to help building on other than gcc.
(bzr r10399)
Diffstat (limited to 'src/box3d.cpp')
| -rw-r--r-- | src/box3d.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/box3d.cpp b/src/box3d.cpp index ac5814e4d..1a9c26b26 100644 --- a/src/box3d.cpp +++ b/src/box3d.cpp @@ -426,6 +426,9 @@ box3d_get_center_screen (SPBox3D *box) { static double remember_snap_threshold = 30; static guint remember_snap_index = 0; +// constant for sizing the array of points to be considered: +static const int MAX_POINT_COUNT = 4; + static Proj::Pt3 box3d_snap (SPBox3D *box, int id, Proj::Pt3 const &pt_proj, Proj::Pt3 const &start_pt) { double z_coord = start_pt[Proj::Z]; @@ -455,7 +458,7 @@ box3d_snap (SPBox3D *box, int id, Proj::Pt3 const &pt_proj, Proj::Pt3 const &sta Box3D::Line diag2(A, E); // diag2 is only taken into account if id equals -1, i.e., if we are snapping the center int num_snap_lines = (id != -1) ? 3 : 4; - Geom::Point snap_pts[num_snap_lines]; + Geom::Point snap_pts[MAX_POINT_COUNT]; snap_pts[0] = pl1.closest_to (pt); snap_pts[1] = pl2.closest_to (pt); @@ -467,7 +470,7 @@ box3d_snap (SPBox3D *box, int id, Proj::Pt3 const &pt_proj, Proj::Pt3 const &sta gdouble const zoom = inkscape_active_desktop()->current_zoom(); // determine the distances to all potential snapping points - double snap_dists[num_snap_lines]; + double snap_dists[MAX_POINT_COUNT]; for (int i = 0; i < num_snap_lines; ++i) { snap_dists[i] = Geom::L2 (snap_pts[i] - pt) * zoom; } |
