mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-24 01:01:57 +00:00
GuiSetBorder: Fix drawing glitch with trimmed lines
This commit is contained in:
parent
5443d7d4eb
commit
e14f8daca4
@ -213,14 +213,18 @@ void GuiSetBorder::drawTop(BorderState draw)
|
||||
}
|
||||
|
||||
|
||||
void GuiSetBorder::undrawWideTopLine()
|
||||
void GuiSetBorder::undrawWideTopLine(bool const right)
|
||||
{
|
||||
if (!top_drawn_wide_)
|
||||
if (!top_drawn_wide_ && !right)
|
||||
return;
|
||||
|
||||
// Overpaint previous lines white
|
||||
drawLine(Qt::white, margin + corner_length + 2, margin + corner_length,
|
||||
bwidth - margin - corner_length - 1, margin + corner_length);
|
||||
if (right)
|
||||
drawLine(Qt::white, margin + 2 * (corner_length + 2), margin + corner_length,
|
||||
bwidth - margin - corner_length - 1, margin + corner_length);
|
||||
else
|
||||
drawLine(Qt::white, margin + corner_length + 2, margin + corner_length,
|
||||
bwidth - margin - corner_length - 1, margin + corner_length);
|
||||
top_drawn_wide_ = false;
|
||||
}
|
||||
|
||||
@ -300,14 +304,18 @@ void GuiSetBorder::drawBottom(BorderState draw)
|
||||
}
|
||||
|
||||
|
||||
void GuiSetBorder::undrawWideBottomLine()
|
||||
void GuiSetBorder::undrawWideBottomLine(bool const right)
|
||||
{
|
||||
if (!bottom_drawn_wide_)
|
||||
if (!bottom_drawn_wide_ && !right)
|
||||
return;
|
||||
|
||||
//Overpaint previous lines white
|
||||
drawLine(Qt::white, margin + corner_length + 2, bwidth - margin - corner_length + 1,
|
||||
bwidth - margin - corner_length - 1, bwidth - margin - corner_length + 1);
|
||||
// Overpaint previous lines white
|
||||
if (right)
|
||||
drawLine(Qt::white, margin + 2 * (corner_length + 2), bwidth - margin - corner_length + 1,
|
||||
bwidth - margin - corner_length - 1, bwidth - margin - corner_length + 1);
|
||||
else
|
||||
drawLine(Qt::white, margin + corner_length + 2, bwidth - margin - corner_length + 1,
|
||||
bwidth - margin - corner_length - 1, bwidth - margin - corner_length + 1);
|
||||
bottom_drawn_wide_ = false;
|
||||
}
|
||||
|
||||
@ -401,10 +409,10 @@ void GuiSetBorder::setTopLeftTrimEnabled(bool enabled)
|
||||
void GuiSetBorder::setTopRightTrimEnabled(bool enabled)
|
||||
{
|
||||
top_trim_right_.enabled = enabled;
|
||||
undrawWideTopLine();
|
||||
undrawWideTopLine(enabled);
|
||||
drawTopRightTrim(top_trim_right_.set);
|
||||
drawTop(top_.set);
|
||||
top_drawn_wide_ = !enabled;;
|
||||
top_drawn_wide_ = !enabled;
|
||||
}
|
||||
|
||||
|
||||
@ -414,17 +422,17 @@ void GuiSetBorder::setBottomLeftTrimEnabled(bool enabled)
|
||||
undrawWideBottomLine();
|
||||
drawBottomLeftTrim(bottom_trim_left_.set);
|
||||
drawBottom(bottom_.set);
|
||||
bottom_drawn_wide_ = !enabled;;
|
||||
bottom_drawn_wide_ = !enabled;
|
||||
}
|
||||
|
||||
|
||||
void GuiSetBorder::setBottomRightTrimEnabled(bool enabled)
|
||||
{
|
||||
bottom_trim_right_.enabled = enabled;
|
||||
undrawWideBottomLine();
|
||||
undrawWideBottomLine(enabled);
|
||||
drawBottomRightTrim(bottom_trim_right_.set);
|
||||
drawBottom(bottom_.set);
|
||||
bottom_drawn_wide_ = !enabled;;
|
||||
bottom_drawn_wide_ = !enabled;
|
||||
}
|
||||
|
||||
|
||||
|
@ -108,9 +108,9 @@ private:
|
||||
void drawLeft(BorderState);
|
||||
void drawRight(BorderState);
|
||||
void drawTop(BorderState);
|
||||
void undrawWideTopLine();
|
||||
void undrawWideTopLine(bool const right = false);
|
||||
void drawBottom(BorderState);
|
||||
void undrawWideBottomLine();
|
||||
void undrawWideBottomLine(bool const right = false);
|
||||
void drawTopLeftTrim(BorderState);
|
||||
void drawTopRightTrim(BorderState);
|
||||
void drawBottomLeftTrim(BorderState);
|
||||
|
Loading…
x
Reference in New Issue
Block a user