mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-24 04:42:51 -04:00
adds scaling to VGA window; closes #800
This commit is contained in:
parent
3efe8f32ee
commit
ff48fa0ac8
@ -54,6 +54,9 @@ public class VGADialog extends JDialog {
|
||||
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
if (getWidth() == image.getWidth() && getHeight() == image.getHeight()) {
|
||||
g.drawImage(image, 0, 0, null);
|
||||
} else {
|
||||
double sx = ((double) getWidth()) / image.getWidth();
|
||||
double sy = ((double) getHeight()) / image.getHeight();
|
||||
|
||||
@ -68,3 +71,4 @@ public class VGADialog extends JDialog {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user