From 8fceb97a396023b335eff75c158fa5ec99cbd01f Mon Sep 17 00:00:00 2001 From: nihui Date: Tue, 12 Dec 2023 22:52:26 +0800 Subject: [PATCH] fix --- patches/opencv-3.4.20-drawing-mono-font.patch | 2 +- patches/opencv-4.8.1-drawing-mono-font.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/opencv-3.4.20-drawing-mono-font.patch b/patches/opencv-3.4.20-drawing-mono-font.patch index 165daca4..d2718adb 100644 --- a/patches/opencv-3.4.20-drawing-mono-font.patch +++ b/patches/opencv-3.4.20-drawing-mono-font.patch @@ -93,7 +93,7 @@ diff -Nuarp opencv-3.4.20.orig/modules/imgproc/src/drawing.cpp opencv-3.4.20/mod double getFontScaleFromHeight(const int fontFace, const int pixelHeight, const int thickness) { -+ return pixelHeight / 16.0; ++ return pixelHeight / (fontFace == 1 ? 16 : (fontFace == 5 ? 24 : 40)); +#if 0 // By https://stackoverflow.com/a/27898487/1531708 const int* ascii = getFontData(fontFace); diff --git a/patches/opencv-4.8.1-drawing-mono-font.patch b/patches/opencv-4.8.1-drawing-mono-font.patch index 145392cb..869ac57b 100644 --- a/patches/opencv-4.8.1-drawing-mono-font.patch +++ b/patches/opencv-4.8.1-drawing-mono-font.patch @@ -93,7 +93,7 @@ diff -Nuarp opencv-4.8.1.orig/modules/imgproc/src/drawing.cpp opencv-4.8.1/modul double getFontScaleFromHeight(const int fontFace, const int pixelHeight, const int thickness) { -+ return pixelHeight / 16.0; ++ return pixelHeight / (fontFace == 1 ? 16 : (fontFace == 5 ? 24 : 40)); +#if 0 // By https://stackoverflow.com/a/27898487/1531708 const int* ascii = getFontData(fontFace);