Fixd lines in visual console (view section). Ticket#2741

This commit is contained in:
Arturo Gonzalez Diaz 2015-09-21 13:42:21 +02:00
parent 3df4b3d9f5
commit 609c0791b7
2 changed files with 24 additions and 16 deletions

View File

@ -104,7 +104,7 @@ foreach ($layoutDatas as $layoutData) {
switch ($layoutData['type']) { switch ($layoutData['type']) {
case LINE_ITEM: case LINE_ITEM:
visual_map_print_user_line_handles($layoutData); visual_map_print_user_line_handles($layoutData);
visual_map_print_user_lines("write", $layoutData); visual_map_print_user_lines($layoutData);
break; break;
default: default:
visual_map_print_item("write", $layoutData); visual_map_print_item("write", $layoutData);

View File

@ -1708,9 +1708,18 @@ function visual_map_get_status_element($layoutData) {
return $status; return $status;
} }
function visual_map_print_user_lines($mode = "read", $layout_data, $proportion = null) { function visual_map_print_user_lines($layout_data, $proportion = null) {
if (empty($proportion)) {
if (!empty($proportion)) { $line = array();
$line["id"] = $layout_data['id'];
$line["start_x"] = $layout_data['pos_x'];
$line["start_y"] = $layout_data['pos_y'];
$line["end_x"] = $layout_data['width'];
$line["end_y"] = $layout_data['height'];
$line["line_width"] = $layout_data['border_width'];
$line["line_color"] = $layout_data['border_color'];
}
else {
$proportion_width = $proportion['proportion_width']; $proportion_width = $proportion['proportion_width'];
$proportion_height = $proportion['proportion_height']; $proportion_height = $proportion['proportion_height'];
@ -1718,7 +1727,6 @@ function visual_map_print_user_lines($mode = "read", $layout_data, $proportion =
if ($proportion_width > $proportion_height) { if ($proportion_width > $proportion_height) {
$proportion_line = $proportion_width; $proportion_line = $proportion_width;
} }
}
$line = array(); $line = array();
$line["id"] = $layout_data['id']; $line["id"] = $layout_data['id'];
@ -1728,6 +1736,7 @@ function visual_map_print_user_lines($mode = "read", $layout_data, $proportion =
$line["end_y"] = $layout_data['height'] * $proportion_height; $line["end_y"] = $layout_data['height'] * $proportion_height;
$line["line_width"] = $layout_data['border_width'] * $proportion_line; $line["line_width"] = $layout_data['border_width'] * $proportion_line;
$line["line_color"] = $layout_data['border_color']; $line["line_color"] = $layout_data['border_color'];
}
echo '<script type="text/javascript">'; echo '<script type="text/javascript">';
echo '$(document).ready (function() { echo '$(document).ready (function() {
@ -1889,8 +1898,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true,
switch ($layout_data['type']) { switch ($layout_data['type']) {
case LINE_ITEM: case LINE_ITEM:
visual_map_print_user_lines("read", $layout_data, visual_map_print_user_lines($layout_data, $proportion);
$proportion);
break; break;
default: default:
visual_map_print_item("read", $layout_data, visual_map_print_item("read", $layout_data,