Revision: 26405
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26405
Author:   kjym3
Date:     2010-01-29 23:13:39 +0100 (Fri, 29 Jan 2010)

Log Message:
-----------
Fixed a bug that caused a Y-direction offset in rendering results.
The renderer now takes the aspect ratio settings into account.

Modified Paths:
--------------
    
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
    
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp

Modified: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
===================================================================
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
     2010-01-29 21:16:21 UTC (rev 26404)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
     2010-01-29 22:13:39 UTC (rev 26405)
@@ -52,8 +52,9 @@
        set_scene_bg( freestyle_scene );
 
        // image dimensions
+       float ycor = ((float)re->r.yasp) / ((float)re->r.xasp);
        float width = freestyle_scene->r.xsch;
-       float height = freestyle_scene->r.ysch;
+       float height = freestyle_scene->r.ysch * ycor;
 
        // Camera
        Object* object_camera = add_object(freestyle_scene, OB_CAMERA);

Modified: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
===================================================================
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
     2010-01-29 21:16:21 UTC (rev 26404)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
     2010-01-29 22:13:39 UTC (rev 26405)
@@ -81,8 +81,9 @@
        //=======================================================
 
        void init_view(Render* re){
+               float ycor = ((float)re->r.yasp) / ((float)re->r.xasp);
                int width = re->scene->r.xsch;
-               int height = re->scene->r.ysch;
+               int height = (int)(((float)re->scene->r.ysch) * ycor);
                
                freestyle_viewport[0] = freestyle_viewport[1] = 0;
                freestyle_viewport[2] = width;
@@ -168,10 +169,12 @@
                rl = render_get_active_layer( freestyle_render, 
freestyle_render->result );
            if( !rl || rl->rectf == NULL) { cout << "Cannot find Freestyle 
result image" << endl; return; }
                src  = rl->rectf;
+               //cout << "src: " << rl->rectx << " x " << rl->recty << endl;
                
                rl = RE_GetRenderLayer(re->result, srl->name);
            if( !rl || rl->rectf == NULL) { cout << "No layer to composite to" 
<< endl; return; }
                dest  = rl->rectf;
+               //cout << "dest: " << rl->rectx << " x " << rl->recty << endl;
                
                rectx = re->rectx;
                recty = re->recty;


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

Reply via email to