Skip to content
Snippets Groups Projects

fontsize options

Merged Lan Dam requested to merge i181_fontsize_options into develop
1 file
+ 11
4
Compare changes
  • Side-by-side
  • Inline
@@ -305,9 +305,18 @@ class PlottingWidget(QtWidgets.QScrollArea):
Set height of figure and main widget according to total of plotting
channels' heights.
Vertical_ratio and fig_height_in_ratio are used to spread out plotting.
However, TPS channels won't need to be spread out.
Calculate height_normalizing_factor.
"""
self.set_size()
# Don't need to spead out channels for TPS
vertical_ratio = (self.main_window.vertical_ratio
if self.name != 'TPS' else 1)
if self.name != 'TPS':
self.fig_height_in *= self.main_window.fig_height_in_ratio
fig_height = math.ceil(self.fig_height_in * self.dpi_y)
# adjusting main_widget to fit view port
@@ -325,8 +334,7 @@ class PlottingWidget(QtWidgets.QScrollArea):
# with height ratio of an item to fit in figure height start from
# 1 to 0.
normalize_total = math.ceil(self.fig_height_in / const.BASIC_HEIGHT_IN)
self.height_normalizing_factor = \
self.main_window.font_ratio / normalize_total
self.height_normalizing_factor = vertical_ratio / normalize_total
if fig_height < max_height:
# to avoid artifact in main widget's section that isn't covered by
@@ -341,8 +349,7 @@ class PlottingWidget(QtWidgets.QScrollArea):
self.plotting_axes.fig.set_figheight(self.fig_height_in)
self.plotting_axes.height_normalizing_factor = \
self.height_normalizing_factor * \
self.main_window.font_ratio
self.height_normalizing_factor * vertical_ratio
# ======================================================================= #
# EVENT
# ======================================================================= #
Loading