Commit Graph

194 Commits

Author SHA1 Message Date
ecb3e0fe73 Cleanup: whitespace & break placement 2015-07-18 19:03:22 +10:00
67bebc42f4 UI: comments (doxygen tweaks) 2015-05-31 14:20:03 +10:00
e4c93dc7db Zoom to frame options, requested by the Hwoozeberry (dutch translation)
team.

There are 3 options here:

1) Keep range (previous behaviour)
2) Seconds - allows a specified offset in seconds around current frame
3) keyframes - zoom to include a number of keyframes around the cursor

Options 2 and 3 have their own properties to tweak the behaviour and all
options can be found in User Preferences->Interface under the 2D
viewports section.

Number 3 will probably need some refinement so commiting here for the
hwoozeberry team to test first.
2015-05-15 13:39:30 +02:00
7478eb9bd0 Cleanup: wrapped function indentation 2015-05-05 05:19:48 +10:00
5e1eb8cdcf Cleanup: rename GRAB_POINTER -> GRAB_CURSOR
Term pointer is overloaded already.
2015-04-27 18:58:53 +10:00
912397756a Fix T44432: Zoom to mouse fails /w FCurve editor 2015-04-21 13:10:32 +10:00
364b6b29ff New operator for action and graph editor that centers around current
scene frame, bound to numberpad zero.
2015-04-13 14:30:24 +02:00
julianeisel
6b107daf23 Fix T43554: Zoom to mousepos makes 2D Views pan after zoom limits are
reached

There are a couple of things that I don't like here, but it seems like
the best way to handle this for now.
2015-02-08 22:35:33 +01:00
5c6e333780 UI Refactor T41640
Make the UI API more consistent and reduce confusion with some naming.

mainly:
- API function calls
- enum values

some internal static functions have been left for now
2014-11-10 23:06:54 +01:00
d73e3f71d4 Revert "Fix T42222"
This reverts commit 507712db3f.

Error was quite an old compiler, which had further warnings/errors.

Old compilers can just have this defined in BLI_math
2014-10-29 11:11:51 +01:00
507712db3f Fix T42222
Avoid using roundf function, since it's oly defined in C99
2014-10-16 12:04:41 +02:00
16791fbecf Fix T41642: Zoom View hotkey: Zoom Position Y doesn't working
Hide zoom settings that have no use in UI/shortcuts definitions.
2014-08-30 16:38:41 +02:00
e71f2fc3ba Cleanup 2014-08-27 09:52:24 +10:00
5df2a98984 Fix T41425: UI wobbles using scrollbar 2014-08-14 13:44:04 +10:00
48446870a8 Code cleanup: remove redundant CTX calls 2014-04-30 08:11:47 +10:00
b6e967be63 Code cleanup: const args and arrays 2014-04-27 08:56:54 +10:00
9ae0e585b0 View2d: API Cleanup for view<->region conversion
View2D had some inconsistencies making it error prone in some cases.

- Inconstant checking for NULL x/y args.
  Disallow NULL args for x/y destination pointers, instead add:
  - UI_view2d_region_to_view_x/y
  - UI_view2d_view_to_region_x/y

- '_no_clip' suffix wasn't always used for non-clipping conversion,
  switch it around and use a '_clip' suffix for all funcs that clip.

- UI_view2d_text_cache_add now clips before adding cache.

- '_clip' funcs return a bool to quickly check if its in the view.

- add conversion for rectangles, since this is a common task:
  - UI_view2d_view_to_region_rcti
  - UI_view2d_region_to_view_rctf
2014-04-21 16:59:40 +10:00
37dd7360d6 Code cleanup: naming conventions 2014-03-16 22:11:14 +11:00
3b5ea6b972 Fix for own error with updating view2d for NDOF 2014-03-01 15:28:51 +11:00
d2548f561c WM: hide screen management and ndof operators from seach popup 2014-02-26 13:48:41 +11:00
739ae1d809 NDOF: fix for view3d ignoring lens values when panning
image, mce, view2d and view3d now have matching pan speed.
2014-02-22 16:30:48 +11:00
dcdb4eaf9c NDOF: Fix for fly/walk mode ignoring axis invert options 2014-02-18 23:55:58 +11:00
5fb2d21390 NDOF: support pan/zoom for view2d (nodes, graph editor, sequencer... etc) 2014-02-18 11:57:49 +11:00
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
7436a3f4ce Correction for recent commit clearing font cache
- move cache reset into view2d and comment about the rationale for resetting cache there.
- missed other places where view2d zoom level can change (smoothview, borderzoom, home and file reload)
- comment about DPI wasn't correct.
2014-01-20 12:45:38 +11:00
d358f1f9e7 Fix last part of T38244: memory leak when scaling any panel
Issue is not noticeable with default font, but i18n one can use more than 500Mo of ram when cached in undreds of different sizes.

Campbell had already done most of the work in rBa780e7f3f09f and rB6b283f116829, just had to call BLF_cache_clear() in _exit funcs of VIEW2D_zoom & co operators.
2014-01-19 15:02:53 +01:00
b9114cb609 UI: Use bool rather then int/short's where possible 2014-01-04 18:10:01 +11:00
63caaa2b12 Code Cleanup: rename vars for detecting change to be more consistent
rename change/is_change/is_changed/modified -> changed
also use bools over int/short/char and once accidental float.
2013-11-26 06:39:14 +11:00
7267221715 remove return argument from wmOperatorType->cancel, was only ever returning OPERATOR_CANCELLED. 2013-10-30 23:08:53 +00:00
b21b24573d lots of operator descriptions were incorrectly copy/pasted.
update some descriptions, others were removed and operators tagged as internal.

add a script to detect duplicate operator descriptions.
2013-09-30 05:50:41 +00:00
23626e0149 fix [#36444] view3d.viewnumpad operator should not animate
when running viewport operations with exec() rather then invoke(), perform the action immediately rather then using smoothview.
makes viewport operations usable from python scripts.
2013-09-16 04:04:44 +00:00
35cd649c66 rename cursor setting functions to make modal set/restore more clearly related functions. 2013-09-06 22:34:29 +00:00
2fefb0fe85 Fix [#36330] Clicking Scrolled Object Properties Tab Brings Up Wrong One
Actually, happened in any view2D... Just added a call to WM_event_add_mousemove() in view_pan_apply, so that overed/active button is refreshed in this case.
2013-08-24 08:46:48 +00:00
43ab02db14 code cleanup: remove redundant NULL checks 2013-07-31 09:18:40 +00:00
397da50002 style cleanup: switch statements, include break statements within braces & indent.
also indent case's within the switch (we already did both of these almost everywhere)
2013-07-19 15:23:42 +00:00
5e347c4f71 code cleanup: typos 2013-05-26 12:02:29 +00:00
aaa8a13c49 code cleanup: use const events for modal and invoke operators. 2013-03-13 09:03:46 +00:00
2e830d05c4 Report #34450
Fix for 2.66a

Some editors in Blender (Like Graph) have "maxzoom" set to 0, which caused the 
MMB zoom sensitivity to be minimal. That used to be much more responsive, restored
it to how it worked before.
2013-02-27 17:12:57 +00:00
aa80a69839 enable grabbing for 2d view zooming, good for the graph editor. 2013-02-27 04:59:39 +00:00
bd7648b2d2 Bug fix #34292
CTRL + MMB zoom in 2d editors now depends on 'max zoom' level. This makes
zooms in UI (very limited) go smoother, but for fcurve or timeline it's same.
2013-02-18 15:14:34 +00:00
7db00f0826 Usability:
Ancient annoying thing for zooming in 2d views: when a view was restricted to keep
aspect ratio, it only allowed vertical or horizontal MMB-drag zooms, depending 
portrait or landscape size of editors. Same for trackpad and magic mouse.

Now vertical zoom drag always works for editors like buttons, nodes.
2013-01-12 11:00:27 +00:00
16ca65e4a9 Solving nasty annoyance:
Trackpad zoom (swipe + CTRL) direction was inverted compared to MMB-drag
or scrollwheel usage. In the 3D viewport it was OK, in all others not.

Now the same physical gesture maps identical to zooming everywhere. Or to
recap (with blender factory settings)

Zooming in:
- MMB-drag, move mouse towards screen
- Scroll wheel, move finger towards screen
- Magic Mouse, move finger towards screen
- Trackpad 2-finger swipe: move fingers toward screen.

To make this extra confusing: this is only consistent if you set your system
to inperpret trackpad swipes as "inverted" (pan view left = swipe to right).
This is a typical default, although Apple wants you to call this "Unnatural" :)

Next commit will be testing on laptop if all pinch gestures zoom consistent.

And following to that, a sensible user preference to map trackpad use for
Blender yourself, to invert system defaults again. :)

Blame and thanks goes to Sebastian Koenig, for his perseverance on getting this
solved :)
2013-01-06 11:16:49 +00:00
dfc63e98bc Trackpad fixes & changes:
- UV Image editor and other 2d views didn't zoom for CTRL+swipe yet.
  (2 finger trackpad, 1 finger mighty mouse)

- Switched defaults for 3D window swiping...
  - default rotate view
  - SHIFT for translate
  - CTRL for zooms

This makes all editors use 'swipe' like 'middle mouse', and not
like scrollwheel (as in releases).

This is nice for consistancy, but it still feels a bit weird...

Of course users can config this in keymaps. We need a sensible
default though, and to make a 2D input input device behave like
middle mouse seeems more sensible than like a 1D wheel...

Proposal therefore for defaults:

- 1D scrollwheels: zoom in 3d, zoom in 2d, but scroll for list views.

- 2D trackpads: pan for all 2d views, rotate for 3D

I'll check with frequent trackpad users about this and we can freeze it
before release. Give it a try :)
2012-12-29 13:21:01 +00:00
fa28e50ac2 Region scrollbar fix!
Now scrollbars correctly hide and show, making space for the actual contents
in a region. It solves several old hacks, and puts view2d code a bit more
back in control as well. 

Implementation notes:

- The view2d mask feature is working again
- The #define V2D_SCROLL_HORIZONTAL_HIDE means: "turn on hiding".
- Code for UI_view2d_region_reinit() is enforcing better standard view settings

But... two hack/patches needed to be added:

- Region panel drawing: if after generating the button panels it appears
  a scroller hides or reveils, it calls all the generating code again.
  (a simple scale doesn't work due to rounding differences in layout code)

- View2d code that maps 'tot' and 'cur' rects: if this code detects that
  the mask changes, it calcs the map code again.

Also a bugfix (issue in 2.65)

- The left/bottom area split widget was drawing 1 pixel too large sometimes, 
  leaving bad trails on moving area dividers.
2012-12-26 13:05:39 +00:00
2a5cabb039 code cleanup and minor changes
- use DummyRNA_NULL_items to replace empty enums.
- replace calloc with malloc in copy_dverts since its copied over after.
- add wmGesture->userdata, so operators that use gestures have somewhere to store their own data (not used yet).
2012-12-22 01:08:42 +00:00
4d8f340d3e Bug fix, own collection:
User preference "Zoom Scale" didn't work correct for 2d views.
(was calculating center of region badly).
2012-12-21 16:11:50 +00:00
f70d2c65d8 rename api functions...
- minf, maxf, mini, maxi --> min_ff, max_ff, min_ii, max_ii
2012-10-23 13:28:22 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
34f674c60e Make zoom direction consistent all over the editors
Was discussed in De Balie with lots of artists and we agreed it makes more
sense to behave this way
2012-10-13 16:42:12 +00:00
affb060c20 Revert part of 51209 -- MOUSEZOOM inversion should be done in lots of other
places as well, but it's quite large change to be done before 'a' release.

For now ignore zoom inverse for 2d view to keep things consistent,
would be re-implemented for all areas after this.
2012-10-09 11:38:42 +00:00