Browse Source

Write plus symbol over each hole

main
Starbeamrainbowlabs 9 months ago
parent
commit
7b7bab1f85
Signed by: sbrl GPG Key ID: 1BE5172E637709C2
  1. 4
      MusicBoxConverter/MusicBoxScoreGenerator.cs
  2. 17
      MusicBoxConverter/SvgWriter.cs
  3. 4
      MusicBoxConverter/Utilities/Vector2.cs

4
MusicBoxConverter/MusicBoxScoreGenerator.cs

@ -151,9 +151,9 @@ namespace MusicBoxConverter
HoleSize // radius
);
svg.WriteCross(
svg.WritePlus(
holePosition,
new Vector2(HoleSize, HoleSize)
new Vector2(HoleSize, HoleSize).Multiply(1.5f)
);
svg.WriteText(

17
MusicBoxConverter/SvgWriter.cs

@ -123,6 +123,23 @@ namespace MusicBoxConverter
}
public void WritePlus(Vector2 centre, Vector2 radius, string strokeStyle = "red", float strokeWidth = 1)
{
WriteLine(
centre.Subtract(new Vector2(0, radius.Y)),
centre.Add(new Vector2(0, radius.Y)),
strokeStyle,
strokeWidth
);
WriteLine(
centre.Subtract(new Vector2(radius.X, 0)),
centre.Add(new Vector2(radius.X, 0)),
strokeStyle,
strokeWidth
);
}
public void StartScaleTransform(float scale)
{
xml.WriteStartElement("g");

4
MusicBoxConverter/Utilities/Vector2.cs

@ -49,7 +49,7 @@ namespace SBRL.Utilities
Y - b.Y
);
}
public Vector2 Divide(int b)
public Vector2 Divide(float b)
{
return new Vector2(
X / b,
@ -63,7 +63,7 @@ namespace SBRL.Utilities
Y / b.Y
);
}
public Vector2 Multiply(int b)
public Vector2 Multiply(float b)
{
return new Vector2(
X * b,

Loading…
Cancel
Save