Internal helper for gg_addReferenceLines to keep diagonal lines in the plot range
Source:R/plot_APCheatmap.R
ensure_segmentsInPlotRange.Rd
Internal helper function to be called from within
gg_addReferenceLines
. This function takes the dataset prepared
for adding diagonal reference lines in the plot, checks if some diagonals
exceed the plot limits, cuts them accordingly, if necessary, and again
returns the corrected dataset.