Fix for compositor node preview sizes: Use the render output aspect ratio for estimat...
authorLukas Toenne <lukas.toenne@googlemail.com>
Fri, 22 Mar 2013 08:50:56 +0000 (08:50 +0000)
committerLukas Toenne <lukas.toenne@googlemail.com>
Fri, 22 Mar 2013 08:50:56 +0000 (08:50 +0000)
source/blender/compositor/intern/COM_compositor.cpp

index 94a27e17b6897e00b90440f08f35d6bdf82d4798..a0f660058f9963fb29bd6ffe17254049f32fd40e 100644 (file)
@@ -65,8 +65,10 @@ void COM_execute(RenderData *rd, bNodeTree *editingtree, int rendering,
 
        /* Make sure node tree has previews.
         * Don't create previews in advance, this is done when adding preview operations.
+        * Reserved preview size is determined by render output for now.
         */
-       BKE_node_preview_init_tree(editingtree, COM_PREVIEW_SIZE, COM_PREVIEW_SIZE, FALSE);
+       float aspect = rd->xsch > 0 ? (float)rd->ysch / (float)rd->xsch : 1.0;
+       BKE_node_preview_init_tree(editingtree, COM_PREVIEW_SIZE, (int)(COM_PREVIEW_SIZE * aspect), FALSE);
 
        /* initialize workscheduler, will check if already done. TODO deinitialize somewhere */
        bool use_opencl = (editingtree->flag & NTREE_COM_OPENCL);