mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
Svg image preview is displayed unscaled and uncentered (#8996)
* Fixed screen centering and scaling problem with SVG files * Little shorter code. * Improved exception caching * typo * fixed upscaling problem * add CSS that IE6 can support it * typo * adding in spelling Co-authored-by: Clint Rutkas <clint@rutkas.com>
This commit is contained in:
@@ -65,6 +65,18 @@ namespace Microsoft.PowerToys.PreviewHandler.Svg
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
svgData = SvgPreviewHandlerHelper.AddStyleSVG(svgData);
|
||||
}
|
||||
#pragma warning disable CA1031 // Do not catch general exception types
|
||||
catch (Exception ex)
|
||||
#pragma warning restore CA1031 // Do not catch general exception types
|
||||
{
|
||||
_browser.ScrollBarsEnabled = true;
|
||||
PowerToysTelemetry.Log.WriteEvent(new SvgFilePreviewError { Message = ex.Message });
|
||||
}
|
||||
|
||||
InvokeOnControlThread(() =>
|
||||
{
|
||||
try
|
||||
@@ -127,7 +139,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Svg
|
||||
_browser.Dock = DockStyle.Fill;
|
||||
_browser.IsWebBrowserContextMenuEnabled = false;
|
||||
_browser.ScriptErrorsSuppressed = true;
|
||||
_browser.ScrollBarsEnabled = true;
|
||||
_browser.ScrollBarsEnabled = false;
|
||||
_browser.AllowNavigation = false;
|
||||
Controls.Add(_browser);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user