Modern mice feature horizontal scrolling capabilities and those end
up being treated by KiCad as regular scroll events causing confusion
among users.
The fix works by discarding the handling of wheel events other than
the ones for the vertical axis.
Fixes: lp:1828080
https://bugs.launchpad.net/kicad/+bug/1828080
GTK3 does a fade in/fade out routine for scrollbars by default. This
was problematic as it caused a cascade of full-screen repaint events on
each mouse event. Instead of disabling scrollbars (which only helped
the full canvas), we force the old scrollbar behavior is environmental
variables.
Revert "gtk3: Remove scrollbars"
This reverts commit db43bd82a7.
The application warps the cursor when initiating some actions (dragging,
selecting modules or Find and Move). This warping should not also
trigger the autopan action.
Fixes: lp:1810787
* https://bugs.launchpad.net/kicad/+bug/1810787
When at small zoom levels, the integer bbox can overflow, preventing
redraw. We fix this by redrawing the full tree when this happens
Fixes: lp:1733067
* https://bugs.launchpad.net/kicad/+bug/1733067
If a Scroll event is skipped, a default handler is fired by wxWidgets.
This default default handler fires 3 wxEVT_SCROLLWIN_LINEUP or wxEVT_SCROLLWIN_LINEDOWN events.
This is not wanted now in eeschema (and pcbnew) because they add extra (unwanted) scrolling.
Fixes: lp:1810403
https://bugs.launchpad.net/kicad/+bug/1810403
Under GTK3, the scrollbars fade in and out, causing a cascade of
re-paint events. These cause KiCad to be unresponsive while the repaint
events occur. By default this is 1s fade in 1s fade out but can be
configured by the user/wm.
Area mapping the repaint events to just scrollbar areas will be a good
solution but until/unless that happens the scrollbars in GTK3 are
problematic.
On GTK+3, the zoom events are smaller and faster, so
the trigger the zoom acceleration.
A simple fix is to use the non-accelerated Mac-style
zooming and an appropriate constant. This can be tweaked
further as needed.
Fixes: lp:1786515
* https://bugs.launchpad.net/kicad/+bug/1786515
GTK3 smooth scrolling is enabled by wxWidgets but not to the exclusion
of normal scroll up/down events. wxWidgets maps these both to the same
scroll handler and will fire them both if they are not handled before
being queued. Testing timestamps allows us to mark and ignore the
dupes.
This is set to GTK3 only for now as it isn't listed as a problem for
other platforms. But it shouldn't cause issues if it is enabled
elsewhere in the future.
The reduces a little bit of WX dependency, and makes
the timing code a bit more type-safe.
Also adds a more testable interface for the accelerated
zoom controller.
This is done to avoid a big chunk of conditionally-compiled code
in the middle of the event function.
Also separates the zoom logic from the WX_VIEW_CONTROLS object
and isolates it in a separate class behind a clearer interface.
Add some simple tests for sane steps on GTK+3-sized scroll
steps.
This parameter defines the working area (full page) size.
The fix is not perfect, because it does not take in account the page size.
However it is similar to the "old" initialization, before Eeschema GAL.
In Eeschema, a reasonable boundary size is used.
Display GALs had an incorrect world unit value set. Now the world unit
value says how many internal units are in an inch, in accord with the comments
in the GAL header. Bitmap drawing code relied on the information about DPI,
so scaling worked differently for display and print GALs.
Fixes a crash when typing fast in the place footprint filter box.
Also adds a bunch more checking to GAL locking, including making
sure the same person unlocks as locked, and preventing piece-meal
calls (the RAII objects must be used).
When querying the view, we do not want to including items that are not
on layers that are currently visible. This routine is currently only
used by the selection tool (pcbnew and gerbview) and the grid helper.
Both expected this logic but were indifferent to the additional items.
Fixes: lp:1796403
* https://bugs.launchpad.net/kicad/+bug/1796403
This fixes some warnings on GCC 8.1:
warning: catching polymorphic type ‘class std::out_of_range’ by value [-Wcatch-value=]
catch( std::out_of_range )
^~~~~~~~~~~~
This fix is along the same lines as:
* ff1802d7a "Fix Coverity "Big parameter passed by value" warnings"
We limit the minimum zoom to Z=0.3. Minimum preset zoom level is 0.31,
so 0.3 is only reachable using the mouse wheel. Smaller than 0.18, GAL
does not display properly.
Fixes: lp:1773215
* https://bugs.launchpad.net/kicad/+bug/1773215
The only required scroll event handler is wxEVT_SCROLLWIN_THUMBTRACK,
which is responsible for dragging the scrolling sliders. One of the
remaining ones is also called when mousewheel is scrolled (MSW only) and
due to that overrides the new view setting with view settings computed
from the sliders position.
Fixes: lp:1767604
* https://bugs.launchpad.net/kicad/+bug/1767604
Since we are going to inspect every item for these calls, we don't
need to use the RTREE search, which is expensive with high item count.
This results in ~50% improvement in layer switching time in GerbView
when working with a set of large Gerber files.
Gal mode: graphic cross-air cursor moved on items when clicking on & DRC error, like in legacy mode.
Make popup menu shown when right clicking on a DRC error item working.
In the previous version the method did not work correctly
when an action was invoked from context menu. In such case,
the cursor position was obtained in the moment of selecting
the action, instead of using the right click location.
A new items is added to the GAL display options (and the dialog), and a
hotkey (Ctrl+Shift+x) is added to toggle it.
Fixes: lp:1673633
* https://bugs.launchpad.net/kicad/+bug/1673633
This is the right implementation of the commit b25ded4d.
Previously if there were tools launched from another tool,
the settings could be stored in a wrong TOOL_STATE object.
Call UseDrawPriority( true ) after creating GAL to enable.
VIEW::Add() gets a new optional argument to specify the draw order
when adding an item. If the new argument is left default, the draw
order will increment with each call of VIEW::Add().
Fix std::bind calls after change to VIEW::Add
The problem with simple deleting VIEW_ITEM_DATA upon VIEW_ITEM removal was
caused by the default copy constructors that copied pointers.
Once a copy of an item was destroyed, the VIEW_ITEM_DATA has been
destroyed, effectively invalidating m_viewPrivData for the other item.
- Finalize transition to BOARD_COMMIT (removed all remaining uses of PICKED_ITEMS_LIST) and implicit view/ratsnest updates
- Simplified SELECTION class, it now can be directly added to a VIEW
- Removed unnecesary casts and templates
- Introduced C++11 features (range based for, lambdas) where they improve code readability
- Added non-undoable COMMITs, which can be used to propagate change notifications to interested listeners (e.g. ratsnest/view)
The standard library requires iterators passed to functions that modify the
container to be mutable iterators, but GCC's implementation accepts
const_iterator in some places where these are only used to mark a place,
but the actual modification happens through a different parameter.
As this breaks implementations that use the passed iterator to modify the
container (e.g. because they use a different data organization), this is
not portable; because we already have a non-const reference to the
container anyway, this is trivially fixed as well.
- resetting relative coordinates
- switching units
- not official: changing transparency for layers (works only for main layers, does not work on vias/pads/etc.)
TOOL_EVENT message is supposed to contain string as parameter.
Added missing header for class_drawsegment.h (KiROUND).
Renamed SELECTION_TOOL::containsSelected() to SELECTION_TOOL::selectionContains().
- VIEW_ITEM::ViewUpdate() does not update items immediately. Now it marks them to be updated and the real update occurs on the next rendering frame.
- VIEW::InvalidateItem() made private.
- VIEW_LAYER::enabled -> visible
- Some functions moved to header files.
Added REASON enum for Reset() function, so tools will know why a reset occured.
Fixed SELECTION_TOOL (it was bailing out, when a new board was loaded and some items were still selected).
Added removal of VIEW_ITEM groups after changing layers and removing items.
Redraws can be requested way too often than it is required. This commit adds redraw timeout:
- if the view became dirty and there has been no redraw for longer than certain time, it is redrawed immediately
- otherwise, we wait for the next frame
This in general improves smoothness of rendering.