mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Skip empty rects in painting.
This commit is contained in:
parent
e50a7a2e42
commit
51d8e9c43d
2 changed files with 18 additions and 6 deletions
|
@ -511,7 +511,7 @@ void Viewport::RendererGL::paintTile(
|
||||||
|
|
||||||
const auto pinVisible = _owner->wide()
|
const auto pinVisible = _owner->wide()
|
||||||
&& (pin.geometry.bottom() > y);
|
&& (pin.geometry.bottom() > y);
|
||||||
if (shown == 0. && !pinVisible) {
|
if (nameShift == fullNameShift && !pinVisible) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -532,16 +532,20 @@ void Viewport::RendererGL::paintTile(
|
||||||
FillTexturedRectangle(f, &*_imageProgram, 4);
|
FillTexturedRectangle(f, &*_imageProgram, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shown == 0.) {
|
if (nameShift == fullNameShift) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mute.
|
// Mute.
|
||||||
FillTexturedRectangle(f, &*_imageProgram, 8);
|
if (!muteRect.empty()) {
|
||||||
|
FillTexturedRectangle(f, &*_imageProgram, 8);
|
||||||
|
}
|
||||||
|
|
||||||
// Name.
|
// Name.
|
||||||
_names.bind(f);
|
if (!nameRect.empty()) {
|
||||||
FillTexturedRectangle(f, &*_imageProgram, 12);
|
_names.bind(f);
|
||||||
|
FillTexturedRectangle(f, &*_imageProgram, 12);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect Viewport::RendererGL::transformRect(const Rect &raster) const {
|
Rect Viewport::RendererGL::transformRect(const Rect &raster) const {
|
||||||
|
@ -745,6 +749,14 @@ void Viewport::RendererGL::validateNames() {
|
||||||
const auto index = _nameDataIndices[i];
|
const auto index = _nameDataIndices[i];
|
||||||
const auto &data = _nameData[_nameDataIndices[i]];
|
const auto &data = _nameData[_nameDataIndices[i]];
|
||||||
const auto row = tiles[i]->row();
|
const auto row = tiles[i]->row();
|
||||||
|
p.setCompositionMode(QPainter::CompositionMode_Source);
|
||||||
|
p.fillRect(
|
||||||
|
0,
|
||||||
|
data.rect.y() / factor,
|
||||||
|
paintToImage.width() / factor,
|
||||||
|
nameHeight / factor,
|
||||||
|
Qt::transparent);
|
||||||
|
p.setCompositionMode(QPainter::CompositionMode_SourceOver);
|
||||||
row->name().drawLeftElided(
|
row->name().drawLeftElided(
|
||||||
p,
|
p,
|
||||||
0,
|
0,
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 808f8c7deafb92ca9b20209e761f576076636565
|
Subproject commit 52d5934dff245d38aa2f2f56e14f853cb01373d3
|
Loading…
Add table
Reference in a new issue