If the main window is not high enough allow the default 32 pixel padding
between the menu bar and the toolbar to shrink down to zero.
This allows the main window height to be a minimum of 688 pixels (on
Windows 10) so it is possible to capture 720P video tutorials.
Fixes#1130
* mac: Support for pan, zoom and rotate trackpad gestures
Currently SolveSpace is nearly unusable on a mac if you only have a
buttonless trackpad and not a mouse, because there's no way to pan
(ie right-click-drag) or rotate (ie middle-click-drag). You can zoom,
but only by using two-finger-drag up and down, which ends up getting
interpreted as a scrollwheel event.
This change makes the app behave much more like any other mac app, by
adding 2-finger-drag pan gesture support and pinch-gesture zooming, and
3D rotate using shift-2-finger-drag.
I've also added support for the rotate two-finger trackpad gesture,
which rotates directly around the screen Z axis (rather than in all 3
dimensions) which is actually something I've found myself wanting to do
with the mouse but afaik there's no equivalent way of achieving that.
While I was there, I fixed a bugette in convertMouseEvent which was
incorrectly translating the NSEvent coordinates, and then fixing up the
fact that the sign of the y-coordinate was wrong as a result. Using the
convertPoint API correctly means that fixup is not required because
convertPoint handles it for you.
* Don't do trackpad gestures on anything except the toplevel window
* mac: Fix non-functional scrollbar on text window
Which has not worked quite right since the last major refactor.
* Don't pass right-button drags to the toolbar
This improves the behaviour of trackpad pan/rotate on mac which uses
simulated right-button events.
* Don't pass cmd/ctrl modifier through on trackpad pan/rotate MouseEvents
By no longer always returning NSTerminateCancel in
applicationShouldTerminate.
And implement applicationWillTerminate to ensure the cleanup code in
SolveSpaceUI::Exit() is always called.
By making IsForcedToMesh() always return true for STL link groups,
rather than trying to set forceToMesh=true during the import phase.
STL link groups are now always shown as "model already forced to
triangle mesh" in the details screen, but also (unlike when the model
is forced to mesh by a parent group) show the '∆' icon in the group
list.
Where each entity in the active workplane sketch is projected a
different amount normal to the workplane, to allow inspection and
easier selection of entities that entirely overlap each other and are
thus otherwise difficult to see or select.
The distance between the exploded "layers" can be controlled in the
configuration page. Negative distances mean the layers are projected in
the opposite direction, relative to the workplane normal.
As per Xcode 12.4 you can at least do a warning-free incremental build
with these changes. There are still plenty of warnings in a full build
(mostly from thirdparty components) but with these changes you can at
least develop on mac and see if/when you've added any new warnings when
doing incremental builds.
- Use `std::vector<T> elemstore` to store elements. Avoids manual memory management.
- Add and index (`std::vector<int> elemidx`) that avoids moving large objects
when adding elements.
- Add a free element list (`std::vector<int> freelist`) that speeds up element removal by
avoiding rearranging the element storage. It also avoids reallocations when adding
elements later.
- Add a proper iterator. It will be used to remove NextAfter - which is a performance bottleneck.
If a single point is selected when a "Constrain | Comment" (`;`) is added
then the comment is associated with the point and its position becomes
relative to the point. In this way the comment will move with the point.
If nothing is selected or more than a single point is selected then
the behaviour is as before and the comment is "floating".
Closes#1032
Keep items in selected state while dragging so that property browser
will track them until the left mouse button is released. Also, trigger
a property browser update on mouse move while dragging to make the
display "live"
Fix a bug with the lookup of stipple pattern for default styles when the
config settings are not yet available (install/upgrade/first run). This
caused hidden lines to display as continuous rather than dashed.
Also, this fixes the Printf format for the ambient lighting entry on the
configuration screen. This was causing string behavior when attempting
to edit the ambient lighting value on Windows. Oddly this didn't seem
to affect Linux.
* minor fix open/save dialogue on windows
On windows 10 the open/save dialogue box has an minor error, and I believe I fixed it.
When "Open" is selected from the menu, the title of the dialogue box says "SolveSpace - Save File" and the entered file name is "united". My fix correctly titles the dialoged box, and leaves the address bar blank when a file is being opened because "united" is only needed as a default name when a file being saved.
I found that class FileDialogImplWin32 from guiwin.cpp contains two if statements for "isSaveDialog". This is redundant. I removed the first where the title was originally set, but not working. I then set the title in the second if statement and moved the 'if isEmpty'' to this section.
* Update guiwin.cpp
replaced tabs with spaces
E.g. for when you have more than one user logged in, in which case
spacenavd works only for the first of those X11 displays.
We try to do it the old way first, so there should be no regressions.
Also fixes storing non-booleans in bool variables.