Skip to content

Commit

Permalink
Fixed NodeGraph resizing to crop rather than scale.
Browse files Browse the repository at this point in the history
Fixes #10.
  • Loading branch information
johnhaddon committed Jan 28, 2014
1 parent f8c225a commit 5b009f8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/GafferUI/ViewportGadget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,16 @@ const Imath::V2i &ViewportGadget::getViewport() const

void ViewportGadget::setViewport( const Imath::V2i &viewport )
{
m_cameraController.setResolution( viewport );
CameraController::ScreenWindowAdjustment adjustment = CameraController::ScaleScreenWindow;
if( const StringData *projection = getCamera()->parametersData()->member<StringData>( "projection" ) )
{
if( projection->readable() == "orthographic" )
{
adjustment = CameraController::CropScreenWindow;
}
}

m_cameraController.setResolution( viewport, adjustment );
}

const IECore::Camera *ViewportGadget::getCamera() const
Expand Down

0 comments on commit 5b009f8

Please sign in to comment.