Commit Graph

220 Commits

Author SHA1 Message Date
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
58e8d0b57e OSX zoom pinch was using inverted direction 2012-10-09 09:38:05 +00:00
de6e47ab3d Correction to zoom-t-mouse formula which was broken since view2d drag zoom refactoring 2012-10-08 17:41:27 +00:00
cd560a1e6a Made View2D drag zoom behave in the same way as zoom in 3d viewport
Initially issue was caused by opposite MMB-Drag zoom direction in nodes editor.

Made it so MMB-Drag in negative axis direction (down for Y axis and left for
X axis) would zoom in, moving in opposite direction will zoom out.

This could kind of break muscule memory, but after discussion with Campbell
decided it's not so big a problem -- seems users weren't related on direction
of zoom in and just waved mouse around until zoom is correct. And now muscule
memory should even be a bit better -- drag zoom is unified between different
areas.
2012-09-28 12:01:21 +00:00
a8ec2a536d fix [#31476] DopeSheet GreasePencil Mode Window won't scroll up 2012-09-28 09:12:02 +00:00
0af15a08da correct own typo from r43404 2012-09-28 09:00:42 +00:00
a12f5bbc7d correct debug/test assignment being left in the UI_view2d_smooth_view() so it always recalculated. 2012-09-26 20:14:30 +00:00
232571c61a code cleanup: replace macro for BLI_rect size/center with inline functions. 2012-09-15 11:48:20 +00:00
aa2d84da37 style cleanup:
also remove some redundant conversions int -> short -> int
2012-09-09 00:00:21 +00:00
7b84a75a22 Fix zooming in/out preview in sequencer
It was a regression since disabling Y-axis zooming in sequencer.
Now check region type and allow all kind of zooming for preview
region.
2012-08-26 16:41:03 +00:00
f4ab3b9d8b sequencer zooms horizontal only from mouse wheel and plus buttons. 2012-08-23 14:49:20 +00:00
c92ab5c3ef code cleanup: use rect size macros 2012-08-21 20:34:05 +00:00
77f47799dd code cleanup: use BLI_RCT_SIZE macro 2012-08-20 23:06:17 +00:00
26f073b327 macros for rectangle center and size 2012-08-20 15:29:02 +00:00
7d3e854aeb add hook now has option to add to active bone (mango request). 2012-08-13 08:54:33 +00:00
3c2b4107de confusion minf/fmin, broke msvc 2012-08-12 19:41:47 +00:00
c140ccb9fd 2d smoothview now scales back the time to move for smaller view zoom/panning.
also the compositor bounds (used for scroll bars), were only calculated when pressing the home key in 2.63, how this is updated on draw
2012-08-12 19:35:47 +00:00
9cce2d8645 smooth-view for 2d views, graph editor, sequencer, node view, works with border zoom, view selected, view all. 2012-08-12 01:07:31 +00:00
5e0f254afa utility functions for getting/setting rectangles for operators. 2012-08-08 20:38:55 +00:00
2a98e83abd style cleanup 2012-07-21 16:21:42 +00:00
cfb7aee017 style cleanup 2012-07-07 22:51:57 +00:00
84bf3e48c0 style cleanup: use c style comments in C code 2012-07-06 23:56:59 +00:00
a6ebffe182 style cleanup: interface 2012-03-30 01:51:25 +00:00
ab4a2aaf4a style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:38:07 +00:00
2f348d8b5d style cleanup: mainly for mesh code, also some WM function use. 2012-03-24 02:51:46 +00:00