From 26a45d5fa9ccac2964177e24d409ade66de95bde Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 25 Apr 2016 13:55:28 -0400 Subject: [PATCH 1/2] Don't rotate dimensions when constructing the monitor because they are already rotated --- src/zm_monitor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index e96997ebc..e66256dea 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -306,8 +306,12 @@ Monitor::Monitor( server_id( p_server_id ), function( (Function)p_function ), enabled( p_enabled ), - width( (p_orientation==ROTATE_90||p_orientation==ROTATE_270)?p_camera->Height():p_camera->Width() ), - height( (p_orientation==ROTATE_90||p_orientation==ROTATE_270)?p_camera->Width():p_camera->Height() ), + // When we instantiate the camera, the dimensions are rotated. So if we rotate them again here, we undo the rotation. + // With this change, calls to Monitor->Width and Height will give the rotated dimesions.So this will trickle down + width( p_camera->Width() ), + height( p_camera->Height() ), + //width( (p_orientation==ROTATE_90||p_orientation==ROTATE_270)?p_camera->Height():p_camera->Width() ), + //height( (p_orientation==ROTATE_90||p_orientation==ROTATE_270)?p_camera->Width():p_camera->Height() ), orientation( (Orientation)p_orientation ), deinterlacing( p_deinterlacing ), label_coord( p_label_coord ), From 85798932ee3f9bb69b357c7825369a88e084d99b Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 25 Apr 2016 14:10:26 -0400 Subject: [PATCH 2/2] Use Event Width and Height, not the Monitor Width and Height. THe Monitor dimensions are not rotated --- web/skins/classic/views/event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/skins/classic/views/event.php b/web/skins/classic/views/event.php index a0b97e35e..d3a185f33 100644 --- a/web/skins/classic/views/event.php +++ b/web/skins/classic/views/event.php @@ -27,7 +27,7 @@ if ( !canView( 'Events' ) ) $eid = validInt( $_REQUEST['eid'] ); $fid = !empty($_REQUEST['fid'])?validInt($_REQUEST['fid']):1; -$sql = 'SELECT E.*,M.Name AS MonitorName,M.Width,M.Height,M.DefaultRate,M.DefaultScale FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?'; +$sql = 'SELECT E.*,M.Name AS MonitorName,E.Width,E.Height,M.DefaultRate,M.DefaultScale FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?'; $sql_values = array( $eid ); if ( $user['MonitorIds'] ) {