mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 22:05:36 +08:00
Added new drawing command "PenColour", with format "PenColour <colourname>;" colour name can be any of the predefined .net System.Drawing.Color names.
This commit is contained in:
@@ -140,7 +140,7 @@ namespace OpenSim.Region.Environment.Modules
|
||||
foreach (string line in lines)
|
||||
{
|
||||
string nextLine = line.Trim();
|
||||
|
||||
//replace with switch, or even better, do some proper parsing
|
||||
if (nextLine.StartsWith("MoveTo"))
|
||||
{
|
||||
float x = 0;
|
||||
@@ -225,6 +225,17 @@ namespace OpenSim.Region.Environment.Modules
|
||||
float size = Convert.ToSingle(nextLine, CultureInfo.InvariantCulture);
|
||||
drawPen.Width = size;
|
||||
}
|
||||
else if (nextLine.StartsWith("PenColour"))
|
||||
{
|
||||
nextLine = nextLine.Remove(0, 9);
|
||||
nextLine = nextLine.Trim();
|
||||
Color newColour = Color.FromName(nextLine);
|
||||
if (newColour != null)
|
||||
{
|
||||
myBrush.Color = newColour;
|
||||
drawPen.Color = newColour;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user