Commit 47334a9d authored by Slava Sharashkin's avatar Slava Sharashkin
Browse files

fixes System.InvalidOperationException when simultaneously rendering multiple images

parent 5cd5cf2a
......@@ -265,7 +265,12 @@ namespace Svg
private void DrawString(GraphicsPath path, SvgUnit x, SvgUnit y, SvgUnit dx, SvgUnit dy, Font font, float fontSize, string text)
{
PointF location = PointF.Empty;
SizeF stringBounds = _stringMeasure.MeasureString(text, font);
SizeF stringBounds;
lock (_stringMeasure)
{
stringBounds = _stringMeasure.MeasureString(text, font);
}
float xToDevice = x.ToDeviceValue(this) + dx.ToDeviceValue(this);
float yToDevice = y.ToDeviceValue(this, true) + dy.ToDeviceValue(this, true);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment