mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 08:15:59 -10:00
* qtFRED: rotate around the centre of a multi-selection Rotate Around Object (Alt+R) and the orbit pivot both used the current object's position, so with several ships marked the camera still circled whichever one happened to be current. Add EditorViewport::selectionCenter(), which returns the centroid of the marked objects when more than one is marked and the given object's position otherwise, and use it at the three places that chose the point: the look-at camera update, orbitCameraGetPivot(), and the Alt+R handler that turns the camera toward the target when the mode is switched on. orbitCameraGetPivot() also serves middle-mouse orbit and wheel zoom in normal mode, so those pivot on the selection centre as well. Every marked type counts at full weight, including waypoints and jump nodes. With a single object marked nothing changes. Fixes #7724 * Make EditorViewport::selectionCenter const It only reads the marked-object list and the editor's marked count; clang-tidy (readability-make-member-function-const) flagged it in CI. * Mirror the multi-selection orbit pivot to FRED, trim comments FRED gets the same selection_center() as qtFRED's selectionCenter(), used at the same three places: the look-at camera update, the orbit pivot, and the Rotate Around Object toggle. Also removes the qtFRED comments flagged in review. * Make the selection-center pivot optional and share object bounds Look-at and orbit use the current object again unless the new option is on (qtFRED: Preferences > Controls; FRED: View menu), and the selection center is now the bounding-box midpoint. view_universe in both editors, the pivot, and qtFRED's selection radius all use get_object_bounds() in missioneditor/common. * Reset the cached orbit pivot when the selection-center option changes Wheel zoom reuses the orbit pivot until the camera moves, so without this the option only took effect for scrolling after the next camera move. * Address review: move and rename the selection-centroid option - FRED: the option moves from the View menu to Settings (and Misc in the classic layout), under Move Ships When Undocking, with hover help, and is renamed Rotate Around Selection Centroid. - qtFRED: the checkbox moves next to Move Ships When Undocking in the preferences dialog, with the same name. - setOrbitSelectionCenter only resets the orbit when the value changes. - get_object_bounds iterates with list_range. - The bounds test resets the object system with obj_init and takes objects off the free list, so it leaves a valid state for other tests. * Rename the option to Selection Midpoint, move it to qtFRED's Controls tab, and document it * Fix overlapping Appearance rows in qtFRED Preferences, realign a settings line The last commit renumbered the Viewport label size row of the Appearance group from 4 to 3, which is the Long list menu style row, so the label size pair fell out of the layout and its spin box drew over the group title. Put it back at row 4. --------- Co-authored-by: Dustinspace217 <[email protected]>