Skip to content

Commit

Permalink
clean tails
Browse files Browse the repository at this point in the history
Signed-off-by: Slice <sergey.slice@gmail.com>
  • Loading branch information
SergeySlice committed Jul 3, 2024
1 parent 1404ba6 commit 0b4a401
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions rEFIt_UEFI/libeg/VectorGraphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions rEFIt_UEFI/libeg/nanosvg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,8 @@ static void nsvg__addShape(NSVGparser* p)
for (int i=0; i<shape->clip.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;
Expand Down
2 changes: 1 addition & 1 deletion rEFIt_UEFI/libeg/nanosvgrast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0b4a401

Please sign in to comment.