Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Assets/SVG Importer/Editor/Core/SVGModifierEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,12 @@ void OnSceneView(SceneView sceneView)
{
switch (current.type)
{
case EventType.mouseDown:
case EventType.MouseDown:
int controlID = GUIUtility.GetControlID(controlIDHash, FocusType.Passive);
GUIUtility.hotControl = controlID;
clickGUIPosition = current.mousePosition;
break;
case EventType.mouseUp:
case EventType.MouseUp:
if((current.mousePosition - clickGUIPosition).sqrMagnitude < 0.1f)
{
layerIndex = GetHighestLayerAtPoint(svgAsset.layers, localMousePosition);
Expand Down Expand Up @@ -369,7 +369,7 @@ void OnSceneView(SceneView sceneView)

if (GUI.changed) EditorUtility.SetDirty(target);

if(current.type == EventType.repaint)
if(current.type == EventType.Repaint)
{
Color handlesColor = Handles.color;
Handles.color = new Color(1f, 1f, 1f, 0.5f);
Expand Down
4 changes: 2 additions & 2 deletions Assets/SVG Importer/Editor/Debug/SVGDebugLayersEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void OnSceneGUI()

void DebugPoints(SVGLayer svgLayer, SVGAsset svgAsset)
{
if(Event.current.type == EventType.repaint)
if(Event.current.type == EventType.Repaint)
{
SVGDebugLayers go = target as SVGDebugLayers;
Matrix4x4 handlesMatrix = Handles.matrix;
Expand All @@ -91,7 +91,7 @@ void DebugPoints(SVGLayer svgLayer, SVGAsset svgAsset)
void DebugPoints(SVGShape svgShape, SVGAsset svgAsset)
{
if(svgShape.vertexCount == 0) return;
if(Event.current.type == EventType.repaint)
if(Event.current.type == EventType.Repaint)
{
SVGDebugLayers go = target as SVGDebugLayers;
Matrix4x4 handlesMatrix = Handles.matrix;
Expand Down
2 changes: 1 addition & 1 deletion Assets/SVG Importer/Editor/Utils/SVGGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void DoLayout(SVGLayer[] layers, LayerSelection layerSelection)
if(rect.Contains(Event.current.mousePosition))
{
hilightedLayer = Mathf.Clamp(Mathf.FloorToInt((Event.current.mousePosition.y - rect.y) / itemHeight), 0, layers.Length);
if(Event.current.type == EventType.scrollWheel)
if(Event.current.type == EventType.ScrollWheel)
{
scrollIndex = Mathf.Clamp(scrollIndex + (int)Mathf.Sign(Event.current.delta.y), 0, layers.Length);
Event.current.Use();
Expand Down
24 changes: 12 additions & 12 deletions Assets/SVG Importer/Editor/Utils/SVGHandles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,15 @@ public static void TransformHandle(SVGTransform2D vrTrs)
}
}

if (type == EventType.mouseDrag)
if (type == EventType.MouseDrag)
{
OnMouseDrag(vrTrs);
GUI.changed = true;
SceneView.RepaintAll();
}

// Cancel Operation
if (Event.current.type == EventType.keyDown && Event.current.keyCode == KeyCode.Escape)
if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Escape)
{
vrTrs.SetTransform(origVrTransform);
Reset();
Expand All @@ -285,7 +285,7 @@ public static void TransformHandle(SVGTransform2D vrTrs)
}
}

if (type == EventType.repaint)
if (type == EventType.Repaint)
{
RenderTransformationGizmos(vrTrs);
}
Expand Down Expand Up @@ -595,7 +595,7 @@ protected static void RenderTransformationGizmos(SVGTransform2D selectionTransfo
Vector2 horizontal = (p2p0 - p1p3).normalized;
Vector2 vertical = (p3p2 - p0p1).normalized;

Handles.DotCap(0, Vector2.Lerp(p2p0, p1p3, 0.5f), capRotation, transformCapSize);
Handles.DotHandleCap(0, Vector2.Lerp(p2p0, p1p3, 0.5f), capRotation, transformCapSize, EventType.Ignore);

// p0
SVGGizmos.ShowScaleCursor(p0, p3 - p0, transformCursorRadius);
Expand All @@ -604,7 +604,7 @@ protected static void RenderTransformationGizmos(SVGTransform2D selectionTransfo
Handles.color = COLOR_HIGHLIGHTED;
else
Handles.color = COLOR_SELECTED;
Handles.DotCap(0, p0, capRotation, transformCapSize);
Handles.DotHandleCap(0, p0, capRotation, transformCapSize, EventType.Ignore);

// p1
SVGGizmos.ShowScaleCursor(p1, p2 - p1, transformCursorRadius);
Expand All @@ -613,7 +613,7 @@ protected static void RenderTransformationGizmos(SVGTransform2D selectionTransfo
Handles.color = COLOR_HIGHLIGHTED;
else
Handles.color = COLOR_SELECTED;
Handles.DotCap(0, p1, capRotation, transformCapSize);
Handles.DotHandleCap(0, p1, capRotation, transformCapSize, EventType.Ignore);

// p2
SVGGizmos.ShowScaleCursor(p2, p1 - p2, transformCursorRadius);
Expand All @@ -622,7 +622,7 @@ protected static void RenderTransformationGizmos(SVGTransform2D selectionTransfo
Handles.color = COLOR_HIGHLIGHTED;
else
Handles.color = COLOR_SELECTED;
Handles.DotCap(0, p2, capRotation, transformCapSize);
Handles.DotHandleCap(0, p2, capRotation, transformCapSize, EventType.Ignore);

// p3
SVGGizmos.ShowScaleCursor(p3, p0 - p3, transformCursorRadius);
Expand All @@ -631,7 +631,7 @@ protected static void RenderTransformationGizmos(SVGTransform2D selectionTransfo
Handles.color = COLOR_HIGHLIGHTED;
else
Handles.color = COLOR_SELECTED;
Handles.DotCap(0, p3, capRotation, transformCapSize);
Handles.DotHandleCap(0, p3, capRotation, transformCapSize, EventType.Ignore);

// p0-p1
SVGGizmos.ShowScaleCursor(p0p1, p3p2 - p0p1, transformCursorRadius);
Expand All @@ -640,7 +640,7 @@ protected static void RenderTransformationGizmos(SVGTransform2D selectionTransfo
Handles.color = COLOR_HIGHLIGHTED;
else
Handles.color = COLOR_SELECTED;
Handles.DotCap(0, p0p1, capRotation, transformCapSize);
Handles.DotHandleCap(0, p0p1, capRotation, transformCapSize, EventType.Ignore);

// p2-p0
SVGGizmos.ShowScaleCursor(p2p0, p1p3 - p2p0, transformCursorRadius);
Expand All @@ -649,7 +649,7 @@ protected static void RenderTransformationGizmos(SVGTransform2D selectionTransfo
Handles.color = COLOR_HIGHLIGHTED;
else
Handles.color = COLOR_SELECTED;
Handles.DotCap(0, p2p0, capRotation, transformCapSize);
Handles.DotHandleCap(0, p2p0, capRotation, transformCapSize, EventType.Ignore);

// p3-p2
SVGGizmos.ShowScaleCursor(p3p2, p0p1 - p3p2, transformCursorRadius);
Expand All @@ -658,7 +658,7 @@ protected static void RenderTransformationGizmos(SVGTransform2D selectionTransfo
Handles.color = COLOR_HIGHLIGHTED;
else
Handles.color = COLOR_SELECTED;
Handles.DotCap(0, p3p2, capRotation, transformCapSize);
Handles.DotHandleCap(0, p3p2, capRotation, transformCapSize, EventType.Ignore);

// p1-p3
SVGGizmos.ShowScaleCursor(p1p3, p2p0 - p1p3, transformCursorRadius);
Expand All @@ -667,7 +667,7 @@ protected static void RenderTransformationGizmos(SVGTransform2D selectionTransfo
Handles.color = COLOR_HIGHLIGHTED;
else
Handles.color = COLOR_SELECTED;
Handles.DotCap(0, p1p3, capRotation, transformCapSize);
Handles.DotHandleCap(0, p1p3, capRotation, transformCapSize, EventType.Ignore);

Handles.color = COLOR_SELECTED;
SVGGizmos.Line(new Vector2[]{p0, p1, p3, p2, p0});
Expand Down
2 changes: 1 addition & 1 deletion Assets/SVG Importer/Editor/Windows/SVGAboutWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public void OnDisable()
static void OnLastRectClick(Action action)
{
Rect lastRect = GUILayoutUtility.GetLastRect();
if(Event.current.type == EventType.mouseDown && lastRect.Contains(Event.current.mousePosition))
if(Event.current.type == EventType.MouseDown && lastRect.Contains(Event.current.mousePosition))
{
if(action == null)
return;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions Assets/SVG Importer/Plugins/Core/SVGAtlas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Rendering;

namespace SVGImporter
{
Expand Down Expand Up @@ -382,7 +383,9 @@ protected void Awake()
_beingDestroyed = false;
AddFakeCamera();

Camera.onPreRender += OnAtlasPreRender;

RenderPipelineManager.beginCameraRendering += OnAtlasPreRender;

#if UNITY_EDITOR
UnityEditor.EditorApplication.update += EditorUpdate;
#endif
Expand All @@ -402,7 +405,8 @@ public void OnPreRender()
protected void OnDestroy()
{
_beingDestroyed = true;
Camera.onPreRender -= OnAtlasPreRender;
RenderPipelineManager.beginCameraRendering -= OnAtlasPreRender;

#if UNITY_EDITOR
UnityEditor.EditorApplication.update -= EditorUpdate;
#endif
Expand All @@ -419,6 +423,12 @@ protected void AddFakeCamera()
camera.useOcclusionCulling = false;
}


public void OnAtlasPreRender(ScriptableRenderContext context, Camera camera = null)
{
OnAtlasPreRender(camera);
}

public void OnAtlasPreRender(Camera camera = null)
{
SVGImporterSettings.UpdateAntialiasing();
Expand Down
44 changes: 44 additions & 0 deletions Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"dependencies": {
"com.unity.collab-proxy": "1.7.1",
"com.unity.ide.rider": "2.0.7",
"com.unity.ide.visualstudio": "2.0.9",
"com.unity.ide.vscode": "1.2.3",
"com.unity.render-pipelines.universal": "10.5.1",
"com.unity.test-framework": "1.1.27",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.4.8",
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.cloth": "1.0.0",
"com.unity.modules.director": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.physics2d": "1.0.0",
"com.unity.modules.screencapture": "1.0.0",
"com.unity.modules.terrain": "1.0.0",
"com.unity.modules.terrainphysics": "1.0.0",
"com.unity.modules.tilemap": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.uielements": "1.0.0",
"com.unity.modules.umbra": "1.0.0",
"com.unity.modules.unityanalytics": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.unitywebrequesttexture": "1.0.0",
"com.unity.modules.unitywebrequestwww": "1.0.0",
"com.unity.modules.vehicles": "1.0.0",
"com.unity.modules.video": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.wind": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
}
Loading