mirror of
https://github.com/maxkratz/lectureStudio.git
synced 2024-09-08 00:03:48 +00:00
presenter: center video feed in PeerView
This commit is contained in:
parent
99b7955cd3
commit
17d6ddfeb2
1 changed files with 4 additions and 1 deletions
|
@ -262,8 +262,11 @@ public class PeerView extends JComponent {
|
|||
AffineTransform imageTransform = new AffineTransform();
|
||||
imageTransform.translate(transform.getTranslateX(), transform.getTranslateY());
|
||||
|
||||
int x = (int) ((getWidth() * transform.getScaleX() - image.getWidth(null)) / 2);
|
||||
int y = (int) ((getHeight() * transform.getScaleX() - image.getHeight(null)) / 2);
|
||||
|
||||
g2.setTransform(imageTransform);
|
||||
g2.drawImage(image, (int) ((getWidth() * transform.getScaleX() - image.getWidth(null)) / 2), 0, null);
|
||||
g2.drawImage(image, x, y, null);
|
||||
g2.setTransform(transform);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue