aleitner commented on code in PR #383:
URL: https://github.com/apache/guacamole-server/pull/383#discussion_r899251626
##########
src/terminal/terminal.c:
##########
@@ -335,6 +335,65 @@ guac_terminal_options* guac_terminal_options_create(
return options;
}
+/**
+ * Calculate the available height and width in pixels within the terminal
+ * and set those values on the terminal struct.
+ * Then use the pixel height and width to calculate the available height and
+ * width in characters and store the results in the pointer arguments.
+ *
+ * @param terminal
+ * The terminal provides character width and height for calculations.
+ * This function requires outer_width, outer_height,
+ * display->margin, display->char_height, and display->char_width
+ * to be set on terminal in order to calculate available dimensions.
+ *
+ * @param columns
+ * Set with the available width for text of the terminal, by column count.
+ *
+ * @param rows
+ * Set with the available height for text of the terminal, by row count.
+ */
+static void calculate_and_save_available_dimensions(guac_terminal* term,
+ int* columns, int* rows) {
Review Comment:
Okay instead of cramming everything into the
`calculate_and_save_available_dimensions` function I separated the logic into
single responsibility functions. The purpose of each function should be much
more straightforward
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]