From b19164cbd2e11a6e49f5e7a5927b51c96b35a8c1 Mon Sep 17 00:00:00 2001
From: Daniel Maya <daniel.maya@artica.es>
Date: Thu, 22 Jun 2017 11:55:30 +0200
Subject: [PATCH] Fixed visual console render img

---
 pandora_console/operation/visual_console/render_view.php | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php
index 79101d82ee..78c29d1e68 100755
--- a/pandora_console/operation/visual_console/render_view.php
+++ b/pandora_console/operation/visual_console/render_view.php
@@ -284,8 +284,13 @@ $ignored_params['refr'] = '';
 				$(this).css('margin-left','');
 			}
 			else {
-				$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
-				$(this).css('margin-top','');
+				if(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2 < 0){
+					$(this).css('margin-left','');
+					$(this).css('margin-top','');
+				} else {
+					$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
+					$(this).css('margin-top','');
+				}
 			}
 		});