Commit Graph

245 Commits

Author SHA1 Message Date
25f5fdc070 View2D: avoid divide-by-zero 2016-02-01 15:23:30 +11:00
2a50760873 Correct fix for T47047
Caused new 2d views to initialize w/o scrollbars
2016-01-25 08:33:22 +11:00
f796e2d3d2 Add missing line width in the 2d view grid drawing 2016-01-24 16:25:22 +05:00
4c6836401e OpenGL: pull glBegin/End out of loops
When drawing 2D grid and 3D axes.
2016-01-22 02:52:11 -05:00
0ded953eea Cleanup: warning/spelling 2016-01-09 22:56:43 +11:00
2d973f44e2 Fix T47047: Toolbars opening at maximum zoom level
There were 2 issues:
- toolbars were set initialized in user-defaults
  so their scroll & zoom level were set.
- initializing new 2d views included the scroll width,
  which scaled the new views zoom level, especially when dragging out.
2016-01-09 06:01:34 +11:00
a1b34c0d28 Fix T46510: VSE View-all crops out image 2015-10-17 02:03:17 +11:00
1ec549886b Cleanup: use bools for v2d, minor ws edits 2015-10-17 01:01:57 +11:00
8bef305b6d Cleanup: move BLI_timestr to BLI_timecode 2015-06-30 14:47:31 +10:00
7a0f57cd01 Cleanup: clarify order of precedence: &/? 2015-06-04 15:41:27 +10:00
67bebc42f4 UI: comments (doxygen tweaks) 2015-05-31 14:20:03 +10:00
5d30c23c35 doxygen: corrections/updates
Also add depsgraph & physics
2015-05-20 14:12:22 +10:00
7478eb9bd0 Cleanup: wrapped function indentation 2015-05-05 05:19:48 +10: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
9e9cd77b8d Compiler warning: double-promotion 2015-02-01 01:17:21 +11:00
aab4f2b762 cleanup: redundant casts & const cast correctness 2015-01-01 23:42:28 +11: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
2c35bcb356 Cleanup: use SELECT flag 2014-10-28 18:39:43 +01:00
384220eeab Partial fix T41749
2d & 3d cached text now draws pixel aligned now.
2014-09-10 15:01:39 +10:00
7df4fc5eaf Spelling 2014-08-13 09:34:37 +10:00
fa17e3b14c UI: refactor text cache to use zero length arrays
also correct some bad casts
2014-06-15 04:32:41 +10:00
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
43d695e82e Code cleanup: view2d api naming 2014-04-21 18:47:17 +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
b1e1f86eb7 Fix for UI_view2d_to_region_float (was ignoring x,y args)
use this for grease pencil stroke conversion to avoid float->int->float conversion.
2014-04-21 14:30:13 +10:00
3e3efae7e9 Viewport Text Drawing: replace single allocs with a memarena
- pass label strlen since in many cases its already known.
- use single linked list for cached text drawing.
- add BLI_link_utils.h for single linked list macros.

own tests give approx 22% overall speedup.
2014-04-17 16:04:28 +10:00
543b57fbeb Fix T38348: Panel remains scrolled when switching tabs 2014-02-22 13:07:02 +11:00
39eb314cb9 UI: Refactor timecode functions into BLI_timecode
- deduplicate timecode_simple_string from image.c
- replace V2D_UNIT_SECONDSSEQ with V2D_UNIT_SECONDS
- avoid possible buffer overflow bugs (sprintf -> BLI_snprintf)
- remove option not to use timecode and split into 2 functions

Patch D227 by Andrew Buttery with own refactoring.
2014-01-29 20:44:01 +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
af93ebcb50 Code Cleanup: style and redundant casts 2014-01-16 19:15:53 +11:00
fab5438943 Code Cleanup: avoid duplicate calls to WM_window_pixels_x/y 2014-01-15 10:41:13 +11:00
cc978dc0c1 Fix for minor precision glitch while zooming on clamped view2d 2014-01-15 10:06:12 +11:00
62aa004c25 Style Cleanup: whitespace 2014-01-12 22:05:24 +11:00
b9114cb609 UI: Use bool rather then int/short's where possible 2014-01-04 18:10:01 +11:00
1ed822202f Code Cleanup: pass rectangles as const in insterface files 2013-12-07 15:47:57 +11:00
1815225faa Blender Font (BLF): add length argument to string width/height functions
This also fixes a crash editing buttons longer then UI_MAX_DRAW_STR
2013-12-02 21:10:07 +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
03dbae07d3 Mask primitives
Currently only circle and square, might be easily
extended in the future.

New primitives are creating at cursor location.
This also implied adding 2d cursor to space clip.

Also fix set 2D cursor location which didn't work
in image editor's mask mode since 2.67.

TODO: draw_image_cursor better be moved to some
      more generic file, but it's not so much
      important for now and might be solved later.

Thanks Campbell for the review!
2013-08-26 20:23:26 +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
c89c716e84 fix [#35613] Dopesheet, Graph Editor Trouble Selecting Channels 2013-06-04 20:26:58 +00:00
98beda156c Fix part of #35372: distorted strokes when painting zoomed out with a small brush
size. Interpolated mouse coordinates should not get rounded to integers.
2013-05-15 11:16:01 +00:00
bde6a939e6 View2D could potentially divide stuff by zero, giving bad matrices. 2013-04-18 10:22:42 +00:00
dfa30f8207 Bug fix #34943
With extreme narrow scaled editors, the slider/mask code in View3d could deliver
zero sized or invalid window matrices.

Needs confirmation from Sergey if it works :)
2013-04-18 10:10:58 +00:00
d466e1d3b4 add BLI_rcti,f_recenter()
fix for uninitialized variable use in radial_control_get_properties() and bad cast in bpy api's foreach_parse_args()
2013-03-19 10:54:52 +00:00
01e9dae3dc code cleanup 2013-03-18 18:25:05 +00:00
Lukas Toenne
4638e5f99a Merge of the PyNodes branch (aka "custom nodes") into trunk.
PyNodes opens up the node system in Blender to scripters and adds a number of UI-level improvements.

=== Dynamic node type registration ===
Node types can now be added at runtime, using the RNA registration mechanism from python. This enables addons such as render engines to create a complete user interface with nodes.

Examples of how such nodes can be defined can be found in my personal wiki docs atm [1] and as a script template in release/scripts/templates_py/custom_nodes.py [2].

=== Node group improvements ===
Each node editor now has a tree history of edited node groups, which allows opening and editing nested node groups. The node editor also supports pinning now, so that different spaces can be used to edit different node groups simultaneously. For more ramblings and rationale see (really old) blog post on code.blender.org [3].

The interface of node groups has been overhauled. Sockets of a node group are no longer displayed in columns on either side, but instead special input/output nodes are used to mirror group sockets inside a node tree. This solves the problem of long node lines in groups and allows more adaptable node layout. Internal sockets can be exposed from a group by either connecting to the extension sockets in input/output nodes (shown as empty circle) or by adding sockets from the node property bar in the "Interface" panel. Further details such as the socket name can also be changed there.

[1] http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes
[2] http://projects.blender.org/scm/viewvc.php/trunk/blender/release/scripts/templates_py/custom_nodes.py?view=markup&root=bf-blender
[3] http://code.blender.org/index.php/2012/01/improving-node-group-interface-editing/
2013-03-18 16:34:57 +00:00
ddddb7bab1 code cleanup: favor braces when blocks have mixed brace use. 2013-03-09 03:46:30 +00:00
a31a93ca3f Compile fixes for recent code cleanups:
* M_PI was not declared for MSVC.
2013-02-21 17:39:48 +00:00
60c1a7898a use radians for BLF_rotation 2013-02-21 17:15:19 +00:00
b6c82b2e84 fix for glitch drawing file selector dividers (would draw apart or on top of each other depending on the view) 2013-02-02 14:11:58 +00:00