Skip to content
Snippets Groups Projects
Commit 9832d88e authored by gb10's avatar gb10
Browse files

Fixed a bug with drawing exons introduced in previous changes

parent c6648824
No related branches found
No related tags found
No related merge requests found
......@@ -836,7 +836,7 @@ static IntRange getVisibleMspRange(MSP *msp, RenderData *data)
if (rangesOverlap(&result, data->displayRange))
{
/* Limit the returned range to the display range. */
boundsLimitRange(&result, data->displayRange);
boundsLimitRange(&result, data->displayRange, FALSE);
}
else
{
......
......@@ -261,25 +261,33 @@ void boundsLimitValue(int *value, const IntRange const *range)
}
/* Utility to bounds-limit the first range to within the second. Maintains the length
* of the range if possible by shifting the range. */
void boundsLimitRange(IntRange *range, const IntRange const *limit)
/* Utility to bounds-limit the first range to within the second. If maintainLen is true, maintains
* the length of the range if possible by shifting the range. */
void boundsLimitRange(IntRange *range, const IntRange const *limit, const gboolean maintainLen)
{
const int len = getRangeLength(range);
if (range->min < limit->min)
{
range->min = limit->min;
range->max = range->min + len;
if (maintainLen)
{
range->max = range->min + len;
}
}
if (range->max > limit->max)
{
range->max = limit->max;
range->min = range->max - len;
/* If limit is shorter than range, we'll have gone lower than the min again */
boundsLimitValue(&range->min, limit);
if (maintainLen)
{
range->min = range->max - len;
/* If limit is shorter than range, we'll have gone lower than the min again */
boundsLimitValue(&range->min, limit);
}
}
......
......@@ -184,7 +184,7 @@ int getRangeCentre(const IntRange const *range);
gboolean valueWithinRange(const int value, const IntRange const *range);
gboolean rangesOverlap(const IntRange const *range1, const IntRange const *range2);
void boundsLimitValue(int *value, const IntRange const *range);
void boundsLimitRange(IntRange *range, const IntRange const *limit);
void boundsLimitRange(IntRange *range, const IntRange const *limit, const gboolean maintainLen);
char convertBaseToCorrectCase(const char charToConvert, const BlxSeqType seqType);
int convertDisplayIdxToDnaIdx(const int inputIdx,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment