Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 86e42c6

Browse files
committed
[[ Drawing ]] Minor fixes
This patch fixes an incorrect constant in the SVG compiler when computing preserve aspect ratio opcodes and removes unused definitions.
1 parent a0280dc commit 86e42c6

File tree

2 files changed

+3
-25
lines changed

2 files changed

+3
-25
lines changed

extensions/script-libraries/drawing/drawing.livecodescript

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,6 @@ constant kMCGDrawingOpcodePath = 19
10111011

10121012
constant kMCGDrawingTransformOpcodeEnd = 0
10131013
constant kMCGDrawingTransformOpcodeAffine = 1
1014-
//constant kMCGDrawingTransformOpcodeViewport = 2
10151014

10161015
constant kMCGDrawingPaintOpcodeEnd = 0
10171016
constant kMCGDrawingPaintOpcodeSolidColor = 1
@@ -1053,7 +1052,6 @@ constant kMCGDrawingPathOpcodeRelativeReverseArcTo = 22
10531052
constant kMCGDrawingPathOpcodeReverseReflexArcTo = 23
10541053
constant kMCGDrawingPathOpcodeRelativeReverseReflexArcTo = 24
10551054
constant kMCGDrawingPathOpcodeCloseSubpath = 25
1056-
constant kMCGDrawingPathOpcodeBearing = 26
10571055

10581056
constant kMCGDrawingPreserveAspectRatioOpcodeNone = 0
10591057
constant kMCGDrawingPreserveAspectRatioOpcodeXMinYMinMeet = 1
@@ -1292,8 +1290,8 @@ private function _svgEncodePreserveAspectRatio pPar
12921290
break
12931291
end switch
12941292
if word 2 of pPar is "slice" then
1295-
put tParOp - kMCGDrawingPreserveAspectRatioXMinYMinMeet + \
1296-
kMCGDrawingPreserveAspectRatioXMinYMinSlice into tParOp
1293+
put tParOp - kMCGDrawingPreserveAspectRatioOpcodeXMinYMinMeet + \
1294+
kMCGDrawingPreserveAspectRatioOpcodeXMinYMinSlice into tParOp
12971295
end if
12981296
return tParOp
12991297
end _svgEncodePreserveAspectRatio
@@ -1306,9 +1304,6 @@ private command _svgEncodeTransform @xContext, pTransform
13061304
break
13071305
case "viewport"
13081306
_InternalError format("dynamic viewport transform not supported")
1309-
1310-
_svgEncodeOp xContext, kMCGDrawingTransformOpcodeViewport, tTransform[2], tTransform[3], tTransform[4], tTransform[5], tTransform[6], tTransform[7], tTransform[8], tTransform[9]
1311-
_svgEncodeOp xContext, _svgEncodePreserveAspectRatio(tTransform[10])
13121307
break
13131308
default
13141309
_InternalError format("unknown transform '%s'", tTransform[1])

libgraphics/src/drawing.cpp

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,8 @@ enum MCGDrawingPathOpcode : uint8_t
462462
kMCGDrawingPathOpcodeReverseReflexArcTo = 23,
463463
kMCGDrawingPathOpcodeRelativeReverseReflexArcTo = 24,
464464
kMCGDrawingPathOpcodeCloseSubpath = 25,
465-
kMCGDrawingPathOpcodeBearing = 26,
466465

467-
kMCGDrawingPathOpcode_Last = kMCGDrawingPathOpcodeBearing,
466+
kMCGDrawingPathOpcode_Last = kMCGDrawingPathOpcodeCloseSubpath,
468467
};
469468

470469
inline bool MCGDrawingPathOpcodeIsRelativeArc(MCGDrawingPathOpcode p_opcode)
@@ -537,7 +536,6 @@ struct MCGDrawingVisitor
537536
void PathSmoothQuadraticTo(bool is_relative, MCGFloat x, MCGFloat y);
538537
void PathArcTo(bool is_relative, bool is_reflex, bool is_reverse, MCGFloat cx, MCGFloat cy, MCGFloat rotation, MCGFloat x, MCGFloat y);
539538
void PathCloseSubpath(void);
540-
void PathBearing(MCGFloat angle);
541539
void PathEnd(void);
542540

543541
void FillOpacity(MCGFloat opacity);
@@ -1784,17 +1782,6 @@ void MCGDrawingContext::ExecutePath(VisitorT& p_visitor)
17841782
p_visitor.PathArcTo(t_is_relative, t_is_reflex, t_is_reverse, t_rx, t_ry, t_rotation, t_x, t_y);
17851783
}
17861784
break;
1787-
1788-
case kMCGDrawingPathOpcodeBearing:
1789-
{
1790-
MCGFloat t_angle;
1791-
if (!AngleScalar(t_angle))
1792-
{
1793-
break;
1794-
}
1795-
p_visitor.PathBearing(t_angle);
1796-
}
1797-
break;
17981785

17991786
case kMCGDrawingPathOpcodeCloseSubpath:
18001787
{
@@ -2052,10 +2039,6 @@ struct MCGDrawingRenderVisitor
20522039
last_point = first_point;
20532040
}
20542041

2055-
void PathBearing(MCGFloat p_angle)
2056-
{
2057-
}
2058-
20592042
void PathEnd(void)
20602043
{
20612044
MCGContextFillAndStroke(gcontext);

0 commit comments

Comments
 (0)