Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/interface/interface_eyedropper.c')
-rw-r--r--source/blender/editors/interface/interface_eyedropper.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/source/blender/editors/interface/interface_eyedropper.c b/source/blender/editors/interface/interface_eyedropper.c
index de39484bc1e..fb8d32b3b84 100644
--- a/source/blender/editors/interface/interface_eyedropper.c
+++ b/source/blender/editors/interface/interface_eyedropper.c
@@ -103,26 +103,41 @@ wmKeyMap *eyedropper_colorband_modal_keymap(wmKeyConfig *keyconf)
*/
/** \name Generic Shared Functions
* \{ */
-
-void eyedropper_draw_cursor_text(const struct bContext *C, const ARegion *region, const char *name)
+static void eyedropper_draw_cursor_text_ex(const int x, const int y, const char *name)
{
const uiFontStyle *fstyle = UI_FSTYLE_WIDGET;
- wmWindow *win = CTX_wm_window(C);
- int x = win->eventstate->x;
- int y = win->eventstate->y;
+
const float col_fg[4] = {1.0f, 1.0f, 1.0f, 1.0f};
const float col_bg[4] = {0.0f, 0.0f, 0.0f, 0.2f};
- if ((name[0] == '\0') || (BLI_rcti_isect_pt(&region->winrct, x, y) == false)) {
+ UI_fontstyle_draw_simple_backdrop(fstyle, x, y + U.widget_unit, name, col_fg, col_bg);
+}
+
+void eyedropper_draw_cursor_text_window(const struct wmWindow *window, const char *name)
+{
+ if (name[0] == '\0') {
return;
}
- x = x - region->winrct.xmin;
- y = y - region->winrct.ymin;
+ const int x = window->eventstate->x;
+ const int y = window->eventstate->y;
- y += U.widget_unit;
+ eyedropper_draw_cursor_text_ex(x, y, name);
+}
+
+void eyedropper_draw_cursor_text_region(const struct bContext *C,
+ const ARegion *region,
+ const char *name)
+{
+ wmWindow *win = CTX_wm_window(C);
+ const int x = win->eventstate->x - region->winrct.xmin;
+ const int y = win->eventstate->y - region->winrct.ymin;
+
+ if ((name[0] == '\0') || (BLI_rcti_isect_pt(&region->winrct, x, y) == false)) {
+ return;
+ }
- UI_fontstyle_draw_simple_backdrop(fstyle, x, y, name, col_fg, col_bg);
+ eyedropper_draw_cursor_text_ex(x, y, name);
}
/**