Blender V5.3
view2d_draw.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <algorithm>
10#include <cfloat>
11#include <cmath>
12#include <cstring>
13
14#include "DNA_scene_types.h"
15#include "DNA_userdef_types.h"
16
17#include "BLI_math_base_c.hh"
18#include "BLI_rect.hh"
19#include "BLI_string_utf8.hh"
20#include "BLI_timecode.hh"
21#include "BLI_utildefines.hh"
22#include "BLI_vector.hh"
23
24#include "GPU_immediate.hh"
25#include "GPU_matrix.hh"
26#include "GPU_state.hh"
27
28#include "WM_api.hh"
29
30#include "BLF_api.hh"
31
32#include "UI_resources.hh"
33#include "UI_view2d.hh"
34
35namespace blender::ui {
36
37/* -------------------------------------------------------------------- */
40
41#define MIN_MAJOR_LINE_DISTANCE (U.v2d_min_gridsize * UI_SCALE_FAC)
42
43/* This number defines the smallest scale unit that will be displayed. For example 100 will give
44 * 1/100 -> 0.01 as the smallest step. This is only relevant for editors that do display subframe
45 * information, for example the Graph Editor. */
46constexpr int subframe_range = 100;
47
48/* This essentially performs a special prime factor decomposition where it can only use 2, 3 and 5
49 * as prime factors. Divisions that result in 2 are preferred. */
50static int get_divisor(const int distance)
51{
52 const int divisors[3] = {2, 3, 5};
53 constexpr uint8_t num_divisors = ARRAY_SIZE(divisors);
54 bool divides_no_remainder[num_divisors];
55
56 for (int i = 0; i < num_divisors; i++) {
57 const int divisor = divisors[i];
58 const int result = distance / divisor;
59 /* If the division was without loss due to integer cast and the result is 2, return
60 * that. Animating on 2s is a very useful thing for animators so the lines should be shown with
61 * that distance. */
62 const bool has_no_remainder = result * divisor == distance;
63 if (has_no_remainder && result == 2) {
64 return divisor;
65 }
66 divides_no_remainder[i] = has_no_remainder;
67 }
68
69 /* If no division results in a 2, take the first to divide cleanly. */
70 for (int i = 0; i < num_divisors; i++) {
71 if (divides_no_remainder[i]) {
72 return divisors[i];
73 }
74 }
75
76 /* In case none of the above if is true, the divisor will be the full distance meaning the next
77 * step down from that number is 1. */
78 return distance;
79}
80
88static int calculate_grid_step(const int base,
89 const float pixel_width,
90 const float view_width,
91 const float min_distance)
92{
93 if (IS_EQF(view_width, 0.0f)) {
94 return 1;
95 }
96 const float pixels_per_view_unit = pixel_width / view_width;
97 int distance = max_ii(base, 1);
98 if (pixels_per_view_unit * distance > min_distance) {
99 /* Shrink the distance. */
100 while (distance > 1) {
101 const int divisor = get_divisor(distance);
102 const int result = (distance / divisor);
103 if (pixels_per_view_unit * result < min_distance) {
104 /* If the distance would fall below the threshold, stop dividing. */
105 break;
106 }
108 }
109 }
110 else {
111 /* Grow the distance, doubling every time. Break just before hitting an integer overflow. This
112 * creates a drawing issue after hitting the limit where the numbers will overlap but that is
113 * better than an endless loop. See #150543. */
114 while (pixels_per_view_unit * distance < min_distance && distance < (1 << 30)) {
115 distance *= 2;
116 }
117 }
118 BLI_assert(distance != 0);
119 return distance;
120}
121
123static float calculate_grid_step_fractions(const int base,
124 const float pixel_width,
125 const float view_width,
126 const float min_distance)
127{
128 float distance = calculate_grid_step(base, pixel_width, view_width, min_distance);
129 if (distance > 1) {
130 return distance;
131 }
132
133 /* Using `calculate_grid_step` to break down subframe_range simulating a larger view. */
135 subframe_range, pixel_width, view_width * subframe_range, min_distance);
136 return distance / subframe_range;
137}
138
140
141/* -------------------------------------------------------------------- */
144
155static void get_parallel_lines_draw_steps(const float line_distance,
156 const float2 view_bounds,
157 float *r_start_value,
158 uint *r_steps)
159{
160 if (view_bounds.x >= view_bounds.y) {
161 *r_start_value = 0;
162 *r_steps = 0;
163 return;
164 }
165
166 BLI_assert(line_distance > 0);
167 *r_start_value = ceilf(view_bounds.x / line_distance) * line_distance;
168
169 if (view_bounds.x <= *r_start_value && view_bounds.y >= *r_start_value) {
170 *r_steps = std::max(0.0f, floorf((view_bounds.y - *r_start_value) / line_distance)) + 1;
171 }
172 else {
173 *r_steps = 0;
174 }
175}
176
181static void draw_parallel_lines(const float line_distance,
182 const rctf *rect,
183 const rcti *rect_mask,
184 const uchar color[3],
185 const char direction)
186{
187 float start_value;
188 uint steps, steps_max;
189
190 if (direction == 'v') {
191 const float2 view_bounds = {rect->xmin, rect->xmax};
192 get_parallel_lines_draw_steps(line_distance, view_bounds, &start_value, &steps);
193 steps_max = BLI_rcti_size_x(rect_mask);
194 }
195 else {
196 BLI_assert(direction == 'h');
197 const float2 view_bounds = {rect->ymin, rect->ymax};
198 get_parallel_lines_draw_steps(line_distance, view_bounds, &start_value, &steps);
199 steps_max = BLI_rcti_size_y(rect_mask);
200 }
201
202 if (steps == 0) {
203 return;
204 }
205
206 if (steps >= steps_max) [[unlikely]] {
207 /* Note that we could draw a solid color,
208 * however this flickers because of numeric instability when zoomed out. */
209 return;
210 }
211
212 GPUVertFormat *format = immVertexFormat();
213 const uint pos = GPU_vertformat_attr_add(format, "pos", gpu::VertAttrType::SFLOAT_32_32);
214
215 if (U.pixelsize > 1.0f) {
216 float viewport[4];
217 GPU_viewport_size_get_f(viewport);
218
220 immUniform2fv("viewportSize", &viewport[2]);
221 /* -1.0f offset here is because the line is too fat due to the builtin anti-aliasing.
222 * TODO: make a variant or a uniform to toggle it off. */
223 immUniform1f("lineWidth", U.pixelsize - 1.0f);
224 }
225 else {
227 }
229 immBegin(GPU_PRIM_LINES, steps * 2);
230
231 if (direction == 'v') {
232 for (uint i = 0; i < steps; i++) {
233 const float xpos = start_value + i * line_distance;
234 immVertex2f(pos, xpos, rect->ymin);
235 immVertex2f(pos, xpos, rect->ymax);
236 }
237 }
238 else {
239 for (uint i = 0; i < steps; i++) {
240 const float ypos = start_value + i * line_distance;
241 immVertex2f(pos, rect->xmin, ypos);
242 immVertex2f(pos, rect->xmax, ypos);
243 }
244 }
245
246 immEnd();
248}
249
250static void view2d_draw_lines_internal(const View2D *v2d,
251 const float line_distance,
252 const uchar color[3],
253 char direction)
254{
257 draw_parallel_lines(line_distance, &v2d->cur, &v2d->mask, color, direction);
259}
260
261static void view2d_draw_lines(const View2D *v2d,
262 const float major_distance,
263 const bool display_minor_lines,
264 const char direction)
265{
266 if (display_minor_lines) {
267 uchar minor_color[3];
268 theme::get_color_shade_3ubv(TH_GRID, 16, minor_color);
269 int distance_int;
270 if (major_distance > 1) {
271 distance_int = round_fl_to_int(major_distance);
272 }
273 else {
274 /* By multiplying by the subframe range, the smallest distance in which minor lines are drawn
275 * is the same as the smallest distance between major lines. We can just do this
276 * multiplication because from the result, the next divisor is found and applied to the
277 * major distance. The returned divisor may be 1. */
278 distance_int = round_fl_to_int(major_distance * subframe_range);
279 }
280 const int divisor = get_divisor(distance_int);
281 const float line_distance = major_distance / divisor;
282 const int pixel_width = BLI_rcti_size_x(&v2d->mask) + 1;
283 const float view_width = BLI_rctf_size_x(&v2d->cur);
284
285 if ((pixel_width / view_width) * (major_distance / divisor) > MIN_MAJOR_LINE_DISTANCE / 5) {
286 view2d_draw_lines_internal(v2d, line_distance, minor_color, direction);
287 }
288 }
289
290 {
291 uchar major_color[3];
292 theme::get_color_3ubv(TH_GRID, major_color);
293 view2d_draw_lines_internal(v2d, major_distance, major_color, direction);
294 }
295}
296
298
299/* -------------------------------------------------------------------- */
302
304 void (*)(const Scene *scene, float value, float step, char *r_str, uint str_maxncpy);
305
310 const View2D *v2d,
311 const float distance,
312 const rcti *rect,
314 const Scene *scene,
315 const int colorid)
316{
317 if (view2d_scale_get_x(v2d) <= 0.0f) {
318 return;
319 }
320
321 float start_value;
322 uint steps;
323 {
324 const float2 view_bounds = {view2d_region_to_view_x(v2d, rect->xmin),
325 view2d_region_to_view_x(v2d, rect->xmax)};
326 get_parallel_lines_draw_steps(distance, view_bounds, &start_value, &steps);
327 const uint steps_max = BLI_rcti_size_x(&v2d->mask) + 1;
328 if (steps >= steps_max) [[unlikely]] {
329 return;
330 }
331 }
332
335
336 const int font_id = BLF_set_default();
337 theme::font_theme_color_set(font_id, colorid);
338
340
341 const float ypos = rect->ymin + 4 * UI_SCALE_FAC;
342 char text[32];
343 for (uint i = 0; i < steps; i++) {
344 const float xpos_view = start_value + i * distance;
345 const float xpos_region = view2d_view_to_region_x(v2d, xpos_view);
346 to_string(scene, xpos_view, distance, text, sizeof(text));
347 const float text_width = BLF_width(font_id, text, strlen(text));
348 BLF_draw_default(xpos_region - std::trunc(text_width / 2.0f), ypos, 0.0f, text, sizeof(text));
349 }
350
353}
354
355static void draw_vertical_scale_indicators(const ARegion *region,
356 const View2D *v2d,
357 float distance,
358 float display_offset,
359 const rcti *rect,
361 const Scene *scene,
362 int colorid)
363{
364 if (view2d_scale_get_y(v2d) <= 0.0f) {
365 return;
366 }
367
368 float start;
369 uint steps;
370 {
371 const float2 view_bounds = {view2d_region_to_view_y(v2d, rect->ymin),
372 view2d_region_to_view_y(v2d, rect->ymax)};
373 get_parallel_lines_draw_steps(distance, view_bounds, &start, &steps);
374 const uint steps_max = BLI_rcti_size_y(&v2d->mask) + 1;
375 if (steps >= steps_max) [[unlikely]] {
376 return;
377 }
378 }
379
382
383 const int font_id = BLF_set_default();
384 theme::font_theme_color_set(font_id, colorid);
385
387
388 BLF_enable(font_id, BLF_SHADOW);
389 float shadow_color[4];
390 theme::get_color_4fv(TH_BACK, shadow_color);
391 BLF_shadow_offset(font_id, 0, 0);
392 BLF_shadow(font_id, FontShadowType::Outline, shadow_color);
393
394 const float x_offset = 8.0f;
395 const float xpos = (rect->xmin + x_offset) * UI_SCALE_FAC;
396 const float ymin = rect->ymin;
397 const float ymax = rect->ymax;
398 const float y_offset = (BLF_height(font_id, "0", 1) / 2.0f) - U.pixelsize;
399
400 for (uint i = 0; i < steps; i++) {
401 const float ypos_view = start + i * distance;
402 const float ypos_region = view2d_view_to_region_y(v2d, ypos_view + display_offset);
403 char text[32];
404 to_string(scene, ypos_view, distance, text, sizeof(text));
405
406 if (ypos_region - y_offset >= ymin && ypos_region + y_offset <= ymax) {
407 BLF_draw_default(xpos, ypos_region - y_offset, 0.0f, text, sizeof(text));
408 }
409 }
410
411 BLF_disable(font_id, BLF_SHADOW);
412
414
416}
417
423 const Scene *scene, const float frame, const float step, char *r_str, const uint str_maxncpy)
424{
425 int brevity_level = -1;
426 if (U.timecode_style == USER_TIMECODE_MINIMAL && step >= scene->frames_per_second()) {
427 brevity_level = 1;
428 }
429
431 str_maxncpy,
432 brevity_level,
433 frame / float(scene->frames_per_second()),
434 scene->frames_per_second(),
435 U.timecode_style);
436}
437
442static void frame_to_string(const Scene * /*user_data*/,
443 const float frame,
444 const float step,
445 char *r_str,
446 const uint str_maxncpy)
447{
448 if (step >= 1.0f) {
449 BLI_snprintf_utf8(r_str, str_maxncpy, "%d", int(frame));
450 }
451 else if (step >= 0.5f) {
452 BLI_snprintf_utf8(r_str, str_maxncpy, "%.1f", frame);
453 }
454 else if (step >= 0.01f) {
455 BLI_snprintf_utf8(r_str, str_maxncpy, "%.2f", frame);
456 }
457 else {
458 BLI_snprintf_utf8(r_str, str_maxncpy, "%.3f", frame);
459 }
460}
461
466 const Scene *scene,
467 const float2 data_bounds)
468{
469 const int font_id = BLF_set_default();
470 char text[32];
471 /* Using abs to remove the influence of the minus sign on the text width. The padding added
472 * should make up for that. This avoids flickering when scrolling horizontally around the 0
473 * point. */
474 to_string(scene, abs(data_bounds.x), 0, text, sizeof(text));
475 const float left_text_width = BLF_width(font_id, text, strlen(text));
476 to_string(scene, abs(data_bounds.y), 0, text, sizeof(text));
477 const float right_text_width = BLF_width(font_id, text, strlen(text));
478 const float max_text_width = max_ff(left_text_width, right_text_width);
479
480 constexpr int text_padding = 6;
481 return max_text_width + text_padding;
482}
483
488static float get_min_line_distance_x(const View2D *v2d,
489 const Scene *scene,
490 const bool display_seconds)
491{
492 const float2 view_range = {v2d->cur.xmin, v2d->cur.xmax};
494 if (display_seconds) {
496 }
497 else {
499 }
500 const float label_width = get_label_width(to_string, scene, view_range);
501 return max_ff(MIN_MAJOR_LINE_DISTANCE, label_width);
502}
503
505
506/* -------------------------------------------------------------------- */
509
510float view2d_grid_resolution_x(const View2D *v2d, const Scene *scene, const bool display_seconds)
511{
512 const float min_line_distance = get_min_line_distance_x(v2d, scene, display_seconds);
513 const int fps = round_db_to_int(scene->frames_per_second());
515 fps, BLI_rcti_size_x(&v2d->mask) + 1, BLI_rctf_size_x(&v2d->cur), min_line_distance);
516}
517
518float view2d_grid_resolution_y__values(const View2D *v2d, const int base)
519{
522}
523
525
526/* -------------------------------------------------------------------- */
529
531 const Scene *scene,
532 const bool display_seconds,
533 const bool show_fractions,
534 bool draw_minor_lines,
535 const int base)
536{
537 const float min_line_distance = get_min_line_distance_x(v2d, scene, display_seconds);
538 float major_line_distance;
539 /* Fractions are only drawn when not showing a timecode. See `view2d_draw_scale_x`. */
540 if (show_fractions && !display_seconds) {
541 major_line_distance = calculate_grid_step_fractions(
542 base, BLI_rcti_size_x(&v2d->mask) + 1, BLI_rctf_size_x(&v2d->cur), min_line_distance);
543 }
544 else {
545 major_line_distance = calculate_grid_step(
546 base, BLI_rcti_size_x(&v2d->mask) + 1, BLI_rctf_size_x(&v2d->cur), min_line_distance);
547 draw_minor_lines = draw_minor_lines && (major_line_distance > 1);
548 }
549 /* The extra check for minor line drawing here is so minor lines are *not* drawn
550 * below a distance of 1. */
551 view2d_draw_lines(v2d, major_line_distance, draw_minor_lines, 'v');
552}
553
555 const Scene *scene,
556 const bool display_seconds,
557 const bool show_fractions,
558 const bool draw_minor_lines)
559{
560 const int fps = round_db_to_int(scene->frames_per_second());
561 view2d_draw_lines_x(v2d, scene, display_seconds, show_fractions, draw_minor_lines, fps);
562}
563
564void view2d_draw_lines_y(const View2D *v2d, const bool show_fractions, const int base)
565{
566 float major_line_distance;
567 if (show_fractions) {
568 major_line_distance = calculate_grid_step_fractions(base,
569 BLI_rcti_size_y(&v2d->mask) + 1,
570 BLI_rctf_size_y(&v2d->cur),
572 }
573 else {
574 major_line_distance = calculate_grid_step(base,
575 BLI_rcti_size_y(&v2d->mask) + 1,
576 BLI_rctf_size_y(&v2d->cur),
578 }
579 view2d_draw_lines(v2d, major_line_distance, true, 'h');
580}
581
583
584/* -------------------------------------------------------------------- */
587
589 const ARegion *region, const View2D *v2d, const rcti *rect, const int colorid, const int base)
590{
593 draw_vertical_scale_indicators(region, v2d, step, 0.0f, rect, frame_to_string, nullptr, colorid);
594}
595
596void view2d_draw_scale_x(const ARegion *region,
597 const View2D *v2d,
598 const rcti *rect,
599 const Scene *scene,
600 const bool display_seconds,
601 const bool show_fractions,
602 const int colorid,
603 const int base)
604{
605 const float min_line_distance = get_min_line_distance_x(v2d, scene, display_seconds);
606 float step;
607 /* The timecode string does not change on fractions of a frame so it makes no sense to display
608 * that. */
609 if (show_fractions && !display_seconds) {
611 base, BLI_rcti_size_x(&v2d->mask) + 1, BLI_rctf_size_x(&v2d->cur), min_line_distance);
612 }
613 else {
615 base, BLI_rcti_size_x(&v2d->mask) + 1, BLI_rctf_size_x(&v2d->cur), min_line_distance);
616 }
617
618 if (display_seconds) {
620 region, v2d, step, rect, frame_to_time_string, scene, colorid);
621 }
622 else {
623 draw_horizontal_scale_indicators(region, v2d, step, rect, frame_to_string, nullptr, colorid);
624 }
625}
626
628
629} // namespace blender::ui
#define UI_SCALE_FAC
#define IS_EQF(a, b)
#define abs
float distance(float, float) RET
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
const char * to_string(ShaderStage stage)
Definition mtl_shader.mm:52
void font_theme_color_set(int fontid, int colorid)
void get_color_4fv(int colorid, float col[4])
void get_color_shade_3ubv(int colorid, int offset, unsigned char col[3])
void get_color_3ubv(int colorid, unsigned char col[3])
static void draw_horizontal_scale_indicators(const ARegion *region, const View2D *v2d, const float distance, const rcti *rect, PositionToString to_string, const Scene *scene, const int colorid)
void view2d_view_ortho(const View2D *v2d)
Definition view2d.cc:1080
void view2d_draw_scale_x(const ARegion *region, const View2D *v2d, const rcti *rect, const Scene *scene, bool display_seconds, bool show_fractions, int colorid, int base)
static void draw_parallel_lines(const float line_distance, const rctf *rect, const rcti *rect_mask, const uchar color[3], const char direction)
static float calculate_grid_step_fractions(const int base, const float pixel_width, const float view_width, const float min_distance)
static void get_parallel_lines_draw_steps(const float line_distance, const float2 view_bounds, float *r_start_value, uint *r_steps)
static void view2d_draw_lines_internal(const View2D *v2d, const float line_distance, const uchar color[3], char direction)
static void frame_to_time_string(const Scene *scene, const float frame, const float step, char *r_str, const uint str_maxncpy)
static int calculate_grid_step(const int base, const float pixel_width, const float view_width, const float min_distance)
float view2d_grid_resolution_y__values(const View2D *v2d, int base)
void view2d_draw_lines_x(const View2D *v2d, const Scene *scene, bool display_seconds, bool show_fractions, bool draw_minor_lines, int base)
static void frame_to_string(const Scene *, const float frame, const float step, char *r_str, const uint str_maxncpy)
void(*)(const Scene *scene, float value, float step, char *r_str, uint str_maxncpy) PositionToString
float view2d_view_to_region_y(const View2D *v2d, float y)
Definition view2d.cc:1678
static void view2d_draw_lines(const View2D *v2d, const float major_distance, const bool display_minor_lines, const char direction)
constexpr int subframe_range
void view2d_draw_lines_y(const View2D *v2d, bool show_fractions, int base)
float view2d_scale_get_y(const View2D *v2d)
Definition view2d.cc:1906
float view2d_grid_resolution_x(const View2D *v2d, const Scene *scene, bool display_seconds)
float view2d_region_to_view_x(const View2D *v2d, float x)
Definition view2d.cc:1640
float view2d_region_to_view_y(const View2D *v2d, float y)
Definition view2d.cc:1645
static float get_min_line_distance_x(const View2D *v2d, const Scene *scene, const bool display_seconds)
float view2d_scale_get_x(const View2D *v2d)
Definition view2d.cc:1902
static void draw_vertical_scale_indicators(const ARegion *region, const View2D *v2d, float distance, float display_offset, const rcti *rect, PositionToString to_string, const Scene *scene, int colorid)
void view2d_draw_scale_y(const ARegion *region, const View2D *v2d, const rcti *rect, int colorid, int base)
static float get_label_width(PositionToString to_string, const Scene *scene, const float2 data_bounds)
void view2d_draw_lines_x_frames(const View2D *v2d, const Scene *scene, bool display_seconds, bool show_fractions, bool draw_minor_lines)
static int get_divisor(const int distance)
float view2d_view_to_region_x(const View2D *v2d, float x)
Definition view2d.cc:1673
UserDef U
Definition blender.cc:58
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
size_t size_t size_t BLI_snprintf_utf8(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
void wmOrtho2_region_pixelspace(const ARegion *region)
void BLF_shadow_offset(int fontid, int x, int y)
Definition blf.cc:979
void immEnd()
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
Definition blf.cc:835
unsigned int uint
Definition BKE_text.h:55
void BLF_shadow(int fontid, FontShadowType type, const float rgba[4]=nullptr)
Definition blf.cc:967
MINLINE int round_fl_to_int(float a)
GPUVertFormat * immVertexFormat()
void BLF_batch_draw_begin()
Definition blf.cc:536
void immBegin(GPUPrimType, uint vertex_len)
MINLINE int max_ii(int a, int b)
void BLF_disable(int fontid, FontFlags flag)
Definition blf.cc:331
void immUnbindProgram()
void immUniformColor3ubv(const unsigned char rgb[3])
void immBindBuiltinProgram(GPUBuiltinShader shader_id)
int BLF_set_default()
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition BLI_rect.hh:207
VecBase< float, 2 > float2
void immUniform1f(const char *name, float x)
void immVertex2f(uint attr_id, float x, float y)
unsigned char uchar
Definition BKE_text.h:58
void GPU_viewport_size_get_f(float coords[4])
Definition gpu_state.cc:258
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition BLI_rect.hh:215
float BLF_height(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
Definition blf.cc:870
unsigned char uint8_t
Definition BKE_text.h:79
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
void BLF_batch_draw_end()
Definition blf.cc:549
uint GPU_vertformat_attr_add(GPUVertFormat *format, StringRef name, gpu::VertAttrType type)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.hh:203
void BLF_draw_default(float x, float y, float z, const char *str, size_t str_len) ATTR_NONNULL()
size_t BLI_timecode_string_from_time(char *str, size_t maxncpy, int brevity_level, float time_seconds, double fps, short timecode_style) ATTR_NONNULL()
Definition timecode.cc:24
void GPU_matrix_pop_projection()
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition BLI_rect.hh:211
MINLINE float max_ff(float a, float b)
void immUniform2fv(const char *name, const float data[2])
void GPU_matrix_push_projection()
void BLF_enable(int fontid, FontFlags flag)
Definition blf.cc:322
@ BLF_SHADOW
Definition BLF_enums.hh:38
MINLINE int round_db_to_int(double a)
#define floorf
#define ceilf
#define MIN_MAJOR_LINE_DISTANCE