Fix overscan mask with DPI scaling
This commit is contained in:
parent
245cc68afa
commit
04ccc15fd4
1 changed files with 5 additions and 5 deletions
|
@ -227,19 +227,19 @@ catch (const agi::Exception &err) {
|
|||
}
|
||||
|
||||
void VideoDisplay::DrawOverscanMask(float horizontal_percent, float vertical_percent) const {
|
||||
Vector2D v(viewport_width, viewport_height);
|
||||
Vector2D v = Vector2D(viewport_width, viewport_height) / scale_factor;
|
||||
Vector2D size = Vector2D(horizontal_percent, vertical_percent) / 2 * v;
|
||||
|
||||
// Clockwise from top-left
|
||||
Vector2D corners[] = {
|
||||
size,
|
||||
Vector2D(viewport_width - size.X(), size),
|
||||
Vector2D(viewport_width / scale_factor - size.X(), size),
|
||||
v - size,
|
||||
Vector2D(size, viewport_height - size.Y())
|
||||
Vector2D(size, viewport_height / scale_factor - size.Y())
|
||||
};
|
||||
|
||||
// Shift to compensate for black bars
|
||||
Vector2D pos(viewport_left, viewport_top);
|
||||
Vector2D pos = Vector2D(viewport_left, viewport_top) / scale_factor;
|
||||
for (auto& corner : corners)
|
||||
corner = corner + pos;
|
||||
|
||||
|
@ -261,7 +261,7 @@ void VideoDisplay::DrawOverscanMask(float horizontal_percent, float vertical_per
|
|||
|
||||
std::vector<int> vstart(1, 0);
|
||||
std::vector<int> vcount(1, count);
|
||||
gl.DrawMultiPolygon(points, vstart, vcount, Vector2D(viewport_left, viewport_top), Vector2D(viewport_width, viewport_height), true);
|
||||
gl.DrawMultiPolygon(points, vstart, vcount, pos, v, true);
|
||||
}
|
||||
|
||||
void VideoDisplay::PositionVideo() {
|
||||
|
|
Loading…
Reference in a new issue