// if autoscale is enabled, scale the image to fill available space
// if useradjustable is also enabled, the autoscaling is only done once
if(imgviewer->autoscale && imgviewer->scale != 0) {
// if autoscale is enabled, scale the image to fill available space
// if useradjustable is also enabled, the autoscaling is only done once
if(imgviewer->autoscale && imgviewer->scale != 0) {
scale = dwidth / dpixwidth;
if(dpixheight * scale > dheight) {
scale = dheight / dpixheight;
scale = dwidth / dpixwidth;
if(dpixheight * scale > dheight) {
scale = dheight / dpixheight;