Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_handlers.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 5,209 Lines • ▼ Show 20 Lines | if (0 == ui_but_contains_point_px_icon(but, data->region, event)) { | ||||
| return WM_UI_HANDLER_BREAK; | return WM_UI_HANDLER_BREAK; | ||||
| } | } | ||||
| if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { | if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { | ||||
| if ((int)(but->a1) == UI_PALETTE_COLOR) { | if ((int)(but->a1) == UI_PALETTE_COLOR) { | ||||
| if (!event->ctrl) { | if (!event->ctrl) { | ||||
| float color[3]; | float color[3]; | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| SceneLayer *sl = CTX_data_scene_layer(C); | ViewLayer *sl = CTX_data_view_layer(C); | ||||
| Paint *paint = BKE_paint_get_active(scene, sl); | Paint *paint = BKE_paint_get_active(scene, sl); | ||||
| Brush *brush = BKE_paint_brush(paint); | Brush *brush = BKE_paint_brush(paint); | ||||
| if (brush->flag & BRUSH_USE_GRADIENT) { | if (brush->flag & BRUSH_USE_GRADIENT) { | ||||
| float *target = &brush->gradient->data[brush->gradient->cur].r; | float *target = &brush->gradient->data[brush->gradient->cur].r; | ||||
| if (but->rnaprop && RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA) { | if (but->rnaprop && RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA) { | ||||
| RNA_property_float_get_array(&but->rnapoin, but->rnaprop, target); | RNA_property_float_get_array(&but->rnapoin, but->rnaprop, target); | ||||
| ▲ Show 20 Lines • Show All 892 Lines • ▼ Show 20 Lines | |||||
| static int ui_do_but_CURVE( | static int ui_do_but_CURVE( | ||||
| bContext *C, uiBlock *block, uiBut *but, | bContext *C, uiBlock *block, uiBut *but, | ||||
| uiHandleButtonData *data, const wmEvent *event) | uiHandleButtonData *data, const wmEvent *event) | ||||
| { | { | ||||
| int mx, my, a; | int mx, my, a; | ||||
| bool changed = false; | bool changed = false; | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| SceneLayer *sl = CTX_data_scene_layer(C); | ViewLayer *sl = CTX_data_view_layer(C); | ||||
| mx = event->x; | mx = event->x; | ||||
| my = event->y; | my = event->y; | ||||
| ui_window_to_block(data->region, block, &mx, &my); | ui_window_to_block(data->region, block, &mx, &my); | ||||
| if (data->state == BUTTON_STATE_HIGHLIGHT) { | if (data->state == BUTTON_STATE_HIGHLIGHT) { | ||||
| if (event->type == LEFTMOUSE && event->val == KM_PRESS) { | if (event->type == LEFTMOUSE && event->val == KM_PRESS) { | ||||
| CurveMapping *cumap = (CurveMapping *)but->poin; | CurveMapping *cumap = (CurveMapping *)but->poin; | ||||
| ▲ Show 20 Lines • Show All 4,208 Lines • Show Last 20 Lines | |||||