Age | Commit message (Collapse) | Author |
|
Similar to 4537eb0c3b1678a6235
|
|
Activating a gizmo used the windows eventstate which may have values
newer than the event used to activate the gizmo.
This meant transforms check for the key that activated transform
could be incorrect.
Support passing an event when calling operators to avoid this problem.
|
|
|
|
Possible fix for T86592.
|
|
Use a shorter/simpler license convention, stops the header taking so
much space.
Follow the SPDX license specification: https://spdx.org/licenses
- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile
While most of the source tree has been included
- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
use different header conventions.
doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.
See P2788 for the script that automated these edits.
Reviewed By: brecht, mont29, sergey
Ref D14069
|
|
Ref T92709
|
|
This change simplifies the parameter list for these functions
and reduces the chance of typos mixing up array indices.
Reviewed By: campbellbarton
Ref D12950
|
|
Use arrays for wmEvent coordinates, this quiets warnings with GCC11.
- `x, y` -> `xy`.
- `prevx, prevy` -> `prev_xy`.
- `prevclickx, prevclicky` -> `prev_click_xy`.
There is still some cleanup such as using `copy_v2_v2_int()`,
this can be done separately.
Reviewed By: campbellbarton, Severin
Ref D12901
|
|
|
|
Draw thumbnails as strip overlay. This works for movie and image strips.
To draw thumbnails, this overlay has to be enabled and strips must be
tall enough.
The thumbnails are loaded from source file using separate thread and
stored in cache.
Drawing code uses only images stored in cache, and if any is missing,
background rendering job is started. If job can not render thumbnail,
to prevent endless loop of creating job for missing image it sets
`SEQ_FLAG_SKIP_THUMBNAILS` bit of `Sequence` flag.
To prevent visual glitches during timeline panning and zooming, `View2D`
flag `V2D_IS_NAVIGATING` is implemented. If bit is set, drawing code
will look for set of evenly distributed thumbnails that should be
guaranteed to exist and also set of previously displayed thumbnails.
Due to volatile nature of cache these thumbnails can be missing anyway,
in which case no new thumbnails will be drawn for particular strip.
Cache capacity is limited to 5000 thumbnails and performs cleanup of
non visible images when limit is reached.
ref T89143
Reviewed By: ISS
Differential Revision: https://developer.blender.org/D12266
|
|
|
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
|
|
Starts scrolling when dragging a node or node link and going outside the current window.
Largely copied from the VIEW2D_OT_edge_pan operator.
Edge panning operator customdata and supporting functions now in
UI_view2d.h, so they could be used by operators in other editor
libraries. The VIEW2D_OT_edge_pan operator also uses this customdata and
shared functions now. Operators properties can be used to configure
edge panning margins and speed for each use case, rather than using
hardcoded values.
The speed function for edge panning has been tweaked somewhat:
* "Speed per pixel" has been replaced with a "speed ramp" distance.
This is more intuitive and also creates an upper bound for the speed,
which can otherwise become extreme with large cursor distance.
* "Max speed" is reached at the end of the speed ramp.
* Padding the region inside and outside is applied as before, but both
values are operator properties now.
Node transform operator also supports edge panning. This requires
an offset for changes in the view2d rect, otherwise nodes are "stuck"
to the original view.
Transform operator had cursor wrapping categorically enabled, but this
gets quite confusing with the edge scrolling mechanism. A new TransInfo
option T_NO_CURSOR_WRAP has been introduced to disable this behavior.
The double negative is a bit annoying, but want to avoid affecting the
existing transform modes, so by default it should still set the
OP_IS_MODAL_GRAB_CURSOR flag (which then sets the WM_CURSOR_WRAP_XY
flag during modal execution).
Reviewed By: HooglyBoogly, JacquesLucke
Differential Revision: https://developer.blender.org/D11073
|
|
Includes fixes to misspelled function names.
Ref D11280
|
|
|
|
USER_ZOOM_CONT only had comments saying this was 'oldstyle',
remove these comments, add brief explanations of the zoom style
in the enum.
|
|
|
|
- Zooming out a lot faster than zooming in,
it had the wrong aspect ratio, make all the preparations
with the factors instead of deltas.
- Improved following the `zoom_invert`
(should not apply to `MOUSEZOOM`) and "trackpad natural scroll"
preferences.
- `zoomfac` adjustment, same as in `view_zoomdrag_modal`.
Ref D8686
|
|
It was already fixed for the mouse in
bcda8cc89b88c999ff64edcc19973d6289bcbf2a, T65837
now the same logic is applied for the track-pad.
Ref D8685
|
|
|
|
|
|
|
|
|
|
Own mistake in rB3a1cf838ca09. Thanks to @jenkm for pointing this out.
|
|
When using a trackpad Zoom to Mouse Position would always zoom to center of canvas.
Differential Revision: https://developer.blender.org/D8683
Reviewed by Brecht Van Lommel
|
|
Ensure that Zoom does not crash on Mac Trackpad by checking for existence of Continuous Zoom timer.
Differential Revision: https://developer.blender.org/D8682
Reviewed by Julian Eisel
|
|
Follow our code style guide by using C-comments for text descriptions.
|
|
Same as 21fc4ae20692, but for view panning this time. Also had to set the poll
callbacks still in this case.
|
|
The change to the `poll()` callback was actually incorrect. But also
reduandant, since the function is actually already executed in the operator.
|
|
Actually, fixes compile error and an incorrect poll.
Caused by 21fc4ae20692 and 3a1cf838ca09.
The poll has to perfrom the `view_zoom_poll()` logic to ensure correct context.
|
|
Multiple related issues:
* `view_zoomdrag_exec()` required `view_zoomdrag_init()` to be called first to
set up data. Can now easily be done in the `_exec()` function as well though.
* Because of that the operators could not be called in an `EXEC_` context (e.g.
`EXEC_REGION_WIN`).
* With "Zoom to Mouse Position" enabled, zooming from a menu or script would
zoom to the mouse position. That should only happen if the operators are
called directly in the editor.
|
|
The poll would already be executed as operator callback, this check was
redundant. Also see previous commit.
|
|
`view_zoomdrag_init()` would perform a number of sanity checks that
`view_zoom_poll()` already executed. The design of operators forsees that
(non-expensive) context sanity checks are done by the `poll()` callbacks, and
the execution callbacks can then just assume that happened. No reason to be
overly pedantic, we don't do that elsewhere either.
Note that this code is from the earliest days of an operator design. So it's
not surprising that it wasn't using the design "properly".
|
|
|
|
|
|
|
|
|
|
Use 'dpi_fac' instead of 'pixelsize' to scale input sensitivity
based on the interface scale.
Also use dpi_fac for view zoom operator.
Thanks to @ISS for investigating.
|
|
Currently there are no functional changes, preparing code to add more
functionality which is to be run from navigation/zoom operators.
|
|
The abbreviation 'init' is brief, unambiguous and already used
in thousands of places, also initialize is often accidentally
written with British spelling.
|
|
Currently if you drag and drop an item from the outliner elsewhere in
the Blender window, the outliner will scroll the entire time, even if the
mouse is far away. This commit adds optional behavior for the edge pan
operator that makes it only act if the mouse is close enough to the region.
Differential Revision: https://developer.blender.org/D8193
|
|
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/interface` module.
No functional changes.
|
|
Regression in 2fdca5bd1981c
|
|
View2DScrollers used the memory manager to allocate memory. This isn't a
problem but in a upcoming change the scrollers will be drawn more often
than it used to (See {D8066}). To limit the number of allocations and
frees this patch will use the stack for allocation.
Reviewed By: Campbell Barton
Differential Revision: https://developer.blender.org/D8076
|
|
|
|
Forgot to include this change from Julian Eisel @Severin in the
previous commit.
|
|
This adds a modal operator called Edge Pan, which is meant to run invisibly
while something inside a region is being dragged. This patch applies this
to dragging panels, but it can be used elsewhere too.
The speed (which is defined relative to how far the mouse is beyond the
boundary) and delay are easily adjustible. and the speed also increases
smoothly from a start value to a max to make it feel more interactive
and less robotic.
Differential Revision: https://developer.blender.org/D7465
|
|
Part of T74432.
Mostly a careful batch rename but had to do few smaller fixes.
Also ran clang-format on affected files.
|