소스 검색

dpr always enlarges smaller images

DarthSim 6 년 전
부모
커밋
435e5d4063
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      process.go

+ 3 - 3
process.go

@@ -73,12 +73,12 @@ func calcScale(width, height int, po *processingOptions, imgtype imageType) floa
 		}
 	}
 
-	scale = scale * po.Dpr
-
 	if !po.Enlarge && scale > 1 && imgtype != imageTypeSVG {
-		return 1
+		scale = 1
 	}
 
+	scale = scale * po.Dpr
+
 	if srcW*scale < 1 {
 		scale = 1 / srcW
 	}