internal void GuiInput_MouseDown(object sender, MouseEventArgs e) { string toolName = m_mainForm.GetToolName(); EzJson j = new EzJson(); j.BeginFunction("tool_down"); j.AddData("pressure", (128).ToString()); j.AddData("x", (int)(e.X / m_canvasWindow.magnification)); j.AddData("y", (int)(e.Y / m_canvasWindow.magnification)); j.AddData("layer", selectedLayerID); j.AddData("tool", toolName); switch (toolName) { case "brush": j.AddData("options", m_mainForm.GetBrushOptions()); break; case "pen": j.AddData("options", m_mainForm.GetPenOptions()); break; default: j.AddData("options", null); break; } m_toolRunner.ParseJSON(j.Finish()); }
internal void GuiInput_PointerDown(object sender, int x, int y, float pressure = 1.0f) { string toolName = m_mainForm.GetToolName(); EzJson j = new EzJson(); j.BeginFunction("tool_down"); j.AddField("pressure", pressure.ToString(CultureInfo.InvariantCulture.NumberFormat)); j.AddField("x", (int)(x / m_canvasWindow.magnification)); j.AddField("y", (int)(y / m_canvasWindow.magnification)); j.AddField("layer", selectedLayerID); j.AddField("tool", toolName); switch (toolName) { case "brush": j.AddObject("options", m_mainForm.GetBrushOptions()); break; case "pen": j.AddObject("options", m_mainForm.GetPenOptions()); break; default: j.AddField("options", ""); break; } m_controller.GuiInput(j.Finish()); }