From 0b4a4018d6706c61058cec7ced565425a151e721 Mon Sep 17 00:00:00 2001 From: Slice Date: Wed, 3 Jul 2024 23:10:48 +0300 Subject: [PATCH] clean tails Signed-off-by: Slice --- rEFIt_UEFI/libeg/VectorGraphics.cpp | 16 ++++++++-------- rEFIt_UEFI/libeg/nanosvg.cpp | 4 ++-- rEFIt_UEFI/libeg/nanosvgrast.cpp | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/rEFIt_UEFI/libeg/VectorGraphics.cpp b/rEFIt_UEFI/libeg/VectorGraphics.cpp index e6ddbcf8e..27b7f9976 100644 --- a/rEFIt_UEFI/libeg/VectorGraphics.cpp +++ b/rEFIt_UEFI/libeg/VectorGraphics.cpp @@ -132,16 +132,16 @@ EFI_STATUS XTheme::ParseSVGXIcon(NSVGparser* SVGParser, INTN Id, const XString8& tx = (Width - realWidth) * 0.5f; ty = (Height - realHeight) * 0.5f; } - float ScaleY = Scale; - if (IconNameX.contains("sequoia") || IconNameX.contains("vent")) { - DBG("[0]=%f [1]=%f [2]=%f [3]=%f\n", bounds[0], bounds[1], bounds[2], bounds[3]); - //[0]=1330.129883 [1]=740.651855 [2]=1458.281494 [3]=886.530396 -// ScaleY = -Scale; - } +// float ScaleY = Scale; +// if (IconNameX.contains("sequoia") || IconNameX.contains("vent")) { +// DBG("[0]=%f [1]=%f [2]=%f [3]=%f\n", bounds[0], bounds[1], bounds[2], bounds[3]); +// //[0]=1330.129883 [1]=740.651855 [2]=1458.281494 [3]=886.530396 +//// ScaleY = -Scale; +// } NSVGrasterizer* rast = nsvg__createRasterizer(); - nsvgRasterize(rast, SVGimage, bounds, IconNameX.c_str(), tx, ty, Scale, ScaleY, (UINT8*)NewImage.GetPixelPtr(0,0), iWidth, iHeight, iWidth*4); + nsvgRasterize(rast, SVGimage, bounds, IconNameX.c_str(), tx, ty, Scale, Scale, (UINT8*)NewImage.GetPixelPtr(0,0), iWidth, iHeight, iWidth*4); nsvg__deleteRasterizer(rast); *Image = NewImage; //copy array @@ -525,7 +525,7 @@ void testSVG() float tx = 0; //-SVGimage->realBounds[0] * Scale; float ty = 0; //-SVGimage->realBounds[1] * Scale; DBG("timing rasterize start tx=%f ty=%f\n", tx, ty); //the aim is measure duration - nsvgRasterize(rast, SVGimage, tx,ty,Scale, -Scale, (UINT8*)NewImage.GetPixelPtr(0,0), (int)Width, (int)Height, (int)Width*4); + nsvgRasterize(rast, SVGimage, tx,ty,Scale, Scale, (UINT8*)NewImage.GetPixelPtr(0,0), (int)Width, (int)Height, (int)Width*4); DBG("timing rasterize end\n"); NewImage.Draw((UGAWidth - Width) / 2, (UGAHeight - Height) / 2); diff --git a/rEFIt_UEFI/libeg/nanosvg.cpp b/rEFIt_UEFI/libeg/nanosvg.cpp index 31944241e..f8abaf9a7 100644 --- a/rEFIt_UEFI/libeg/nanosvg.cpp +++ b/rEFIt_UEFI/libeg/nanosvg.cpp @@ -1136,8 +1136,8 @@ static void nsvg__addShape(NSVGparser* p) for (int i=0; iclip.count; i++) { shape->clip.index[i] = p->clipPathStack[i]; } - bool dump = (strstr(shape->id, "path8seq") != NULL); - nsvg__getLocalBounds(shape->bounds, shape, dump); //(dest, src) +// bool dump = (strstr(shape->id, "path8seq") != NULL); + nsvg__getLocalBounds(shape->bounds, shape, false); //(dest, src) // Set fill shape->fill.type = NSVG_PAINT_NONE; diff --git a/rEFIt_UEFI/libeg/nanosvgrast.cpp b/rEFIt_UEFI/libeg/nanosvgrast.cpp index 36ce62a83..b1d425363 100644 --- a/rEFIt_UEFI/libeg/nanosvgrast.cpp +++ b/rEFIt_UEFI/libeg/nanosvgrast.cpp @@ -1810,7 +1810,7 @@ void nsvgRasterize(NSVGrasterizer* r, NSVGimage* image, float tx, float ty, float scalex, float scaley, UINT8* dst, int w, int h, int stride) { - nsvgRasterize(r, image, &image->realBounds[0], NULL, tx, ty, scalex, fabsf(scaley), dst, w, h, stride); + nsvgRasterize(r, image, &image->realBounds[0], NULL, tx, ty, scalex, scaley, dst, w, h, stride); } void nsvgRasterize(NSVGrasterizer* r,