Commit Graph

304 Commits

Author SHA1 Message Date
Julian Eisel
4b365064cf Remove most (maybe all?) remaining yellow text
Decided to request the text color as argument for UI_fonstyle_draw
functions, rather than keeping it being another state to keep track of.
2017-02-10 00:17:50 +01:00
5ad5bb235b fix most UI text color
There are still many places to fix. I'll miss the bright yellow!

This commit also uses the new BLF_default function where possible.

Part of T49043 since we call glColor less often.
2017-02-05 00:54:21 -05:00
e369b85e2f Replacing UI_view2d_scrollsers_draw() to immedaite mode
Part of T49043

Reviewers: krash, merwin

Reviewed By: krash, merwin

Differential Revision: https://developer.blender.org/D2364
2016-11-28 20:14:15 -05:00
c6d6f39153 Moved UI_view2_multi_grid_draw() to Gawain
Part of T49043, to replace gl immediate calls with Gawain

Reviewers: krash, merwin

Reviewed By: krash, merwin

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2363
2016-11-28 20:11:13 -05:00
e0bea34c51 fix problem from D2360
I was too eager to get patch in after a last-minute change. My bad!
2016-11-18 00:40:40 -05:00
43ed3079e2 Moved UI_view2d_grid_draw() to immediate functions
Part of T49043

Reviewers: krash, merwin

Reviewed By: krash, merwin

Differential Revision: https://developer.blender.org/D2360
2016-11-17 22:49:22 -05:00
3b06c42616 Blender2.8 convert UI_view2d_constant_grid_draw to new immediate mode
Convert UI_view2d_constant_grid_draw to new immediate mode.

Part of T49043.

Reviewers: merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2298
2016-11-15 18:59:24 -05:00
878938f203 OpenGL: remove some unused legacy matrix calls
Part of T49450
2016-10-15 19:08:19 -04:00
Julian Eisel
49ba9740b8 Cleanup: Duplicated function
wmOrtho2_region_pixelspace and wmOrtho2_region_ui were doing exact same thing since rBSa86482f81cf3.
2016-02-29 15:20:09 +01:00
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