Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_draw.c
| Show All 16 Lines | |||||
| * | * | ||||
| * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. | * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. | ||||
| * All rights reserved. | * All rights reserved. | ||||
| * | * | ||||
| * Contributor(s): Blender Foundation | * Contributor(s): Blender Foundation | ||||
| * | * | ||||
| * ***** END GPL LICENSE BLOCK ***** | * ***** END GPL LICENSE BLOCK ***** | ||||
| */ | */ | ||||
| /** \file blender/editors/interface/interface_draw.c | /** \file blender/editors/interface/interface_draw.c | ||||
| * \ingroup edinterface | * \ingroup edinterface | ||||
| */ | */ | ||||
| #include <math.h> | #include <math.h> | ||||
| #include <string.h> | #include <string.h> | ||||
| ▲ Show 20 Lines • Show All 409 Lines • ▼ Show 20 Lines | #endif | ||||
| glDisable(GL_BLEND); | glDisable(GL_BLEND); | ||||
| #if 0 | #if 0 | ||||
| // restore scissortest | // restore scissortest | ||||
| glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); | glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); | ||||
| #endif | #endif | ||||
| #endif | #endif | ||||
| } | } | ||||
campbellbarton: would use `..._x/_y` here too. | |||||
Not Done Inline ActionsEither document parameters or drop them from the comment. sergey: Either document parameters or drop them from the comment. | |||||
| /** | |||||
| * Draw title and text safe areas. | |||||
| * | |||||
| * The first 4 parameters are the offsets for the view, not the zones. | |||||
| */ | |||||
| void UI_draw_safe_areas(float x1, float x2, float y1, float y2, | |||||
Not Done Inline Actions
dfelinto: 1) This function should be in the 3dview code, not in ui/interface.
2) broadcast is a very… | |||||
| const float title_aspect[2], const float action_aspect[2]) | |||||
| { | |||||
| const float size_x_half = (x2 - x1) * 0.5f; | |||||
| const float size_y_half = (y2 - y1) * 0.5f; | |||||
| float margin_x; | |||||
| float margin_y; | |||||
| UI_ThemeColorBlendShade(TH_VIEW_OVERLAY, TH_BACK, 0.25f, 0); | |||||
Not Done Inline ActionsAvoid double promotion - UI_ThemeColorBlendShade(TH_VIEW_OVERLAY, TH_BACK, 0.25, 0); + UI_ThemeColorBlendShade(TH_VIEW_OVERLAY, TH_BACK, 0.25f, 0); dfelinto: Avoid double promotion
```
- UI_ThemeColorBlendShade(TH_VIEW_OVERLAY, TH_BACK, 0.25, 0);
+… | |||||
| /* Image/Graphics Safe */ | |||||
Not Done Inline ActionsRounded edge of 2.0 is barely noticeable, may as well just draw a square. campbellbarton: Rounded edge of 2.0 is barely noticeable, may as well just draw a square. | |||||
| if (title_aspect[0] || title_aspect[1]) { | |||||
| margin_x = title_aspect[0] * size_x_half; | |||||
| margin_y = title_aspect[1] * size_y_half; | |||||
| UI_draw_roundbox_unfilled(x1 + margin_x, y1 + margin_y, x2 - margin_x, y2 - margin_y, 0); | |||||
| } | |||||
| /* Title Safe */ | |||||
| if (action_aspect[0] || action_aspect[1]) { | |||||
| margin_x = action_aspect[0] * size_x_half; | |||||
| margin_y = action_aspect[1] * size_y_half; | |||||
| UI_draw_roundbox_unfilled(x1 + margin_x, y1 + margin_y, x2 - margin_x, y2 - margin_y, 0); | |||||
| } | |||||
| } | |||||
| static void draw_scope_end(const rctf *rect, GLint *scissor) | static void draw_scope_end(const rctf *rect, GLint *scissor) | ||||
| { | { | ||||
| /* restore scissortest */ | /* restore scissortest */ | ||||
| glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); | glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); | ||||
| glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | ||||
| /* outline */ | /* outline */ | ||||
| ▲ Show 20 Lines • Show All 1,321 Lines • Show Last 20 Lines | |||||
would use ..._x/_y here too.