Commit: b749dc875f092e4b084865ab6653465b82e8910c
Author: Julian Eisel
Date:   Wed Apr 8 12:45:11 2015 +0200
Branches: wiggly-widgets
https://developer.blender.org/rBb749dc875f092e4b084865ab6653465b82e8910c

Some tweaks for the Graph Editor backdrop

Should be ready for testing now :)

===================================================================

M       source/blender/blenloader/intern/versioning_270.c
M       source/blender/editors/space_graph/graph_edit.c
M       source/blender/editors/space_graph/space_graph.c

===================================================================

diff --git a/source/blender/blenloader/intern/versioning_270.c 
b/source/blender/blenloader/intern/versioning_270.c
index 7b89794..a8a351d 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -840,7 +840,7 @@ void blo_do_versions_270(FileData *fd, Library 
*UNUSED(lib), Main *main)
                                                if (sl->spacetype == SPACE_IPO) 
{
                                                        SpaceIpo *sipo = 
(SpaceIpo *)sl;
                                                        sipo->backdrop_zoom = 
1.0f;
-                                                       sipo->backdrop_opacity 
= 0.6f;
+                                                       sipo->backdrop_opacity 
= 0.7f;
                                                }
                                        }
                                }
diff --git a/source/blender/editors/space_graph/graph_edit.c 
b/source/blender/editors/space_graph/graph_edit.c
index dee8d00..167cb44 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -2488,8 +2488,8 @@ static void widgetgroup_backdrop_draw(const struct 
bContext *C, struct wmWidgetG
        ARegion *ar = CTX_wm_region(C);
        wmOperator *op = wgroup->type->op;
        Scene *scene = CTX_data_scene(C);
-       int width = (scene->r.xsch * scene->r.size) / 100;
-       int height = (scene->r.ysch * scene->r.size) / 100;
+       int width = (scene->r.size * scene->r.xsch) / 150.0f;
+       int height = (scene->r.size * scene->r.ysch) / 150.0f;
        float origin[3];
 
        wmWidget *cage = WIDGET_rect_transform_new(wgroup, 
WIDGET_RECT_TRANSFORM_STYLE_SCALE_UNIFORM |
diff --git a/source/blender/editors/space_graph/space_graph.c 
b/source/blender/editors/space_graph/space_graph.c
index 911216a..b49ad63 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -256,21 +256,16 @@ static void graph_main_area_draw(const bContext *C, 
ARegion *ar)
        ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW);
        
        if (draw_backdrop) {
-               int width = (scene->r.xsch * scene->r.size) / 100;
-               int height = (scene->r.ysch * scene->r.size) / 100;
-               float x = (BLI_rcti_size_x(&ar->winrct) - width) / 2.0f; /* 
center of the screen */
-               float y = (BLI_rcti_size_y(&ar->winrct) - height) / 2.0f; /* 
below upper edge with small offset */
-               
-               width *= sipo->backdrop_zoom;
-               height *= sipo->backdrop_zoom;
-               x += sipo->backdrop_offset[0];
-               y += sipo->backdrop_offset[1];
+               int width = (scene->r.size * scene->r.xsch) / 150 * 
sipo->backdrop_zoom;
+               int height = (scene->r.size * scene->r.ysch) / 150 * 
sipo->backdrop_zoom;
+               float xofs = (BLI_rcti_size_x(&ar->winrct) - width) / 2.0f + 
sipo->backdrop_offset[0];
+               float yofs = (BLI_rcti_size_y(&ar->winrct) - height) / 2.0f + 
sipo->backdrop_offset[1];
                
                /* reset view matrix */
                UI_view2d_view_restore(C);
                
                ED_region_draw_backdrop_view3d(C, sipo->backdrop_camera, 
sipo->backdrop_opacity,
-                                              width, height, x, y, 1.0f, 1.0f, 
true);
+                                              width, height, xofs, yofs, 1.0f, 
1.0f, true);
                
                UI_view2d_view_ortho(v2d);
        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to