123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace GUI
- {
- public partial class ScaleRule : UserControl
- {
- float degree;
- public float Degree
- {
- get => degree;
- set
- {
- value = Math.Abs(value % 360);
- if (value > 174)
- {
- float t = value - 174;
- float v = -t * 1.542f;
- ScalePane.Location = new Point((int)v, 0);
- }
- else
- {
- float t = 174 - value;
- float v = t * 1.542f - 554f;
- ScalePane.Location = new Point((int)v, 0);
- }
- degree = value;
- }
- }
- public ScaleRule()
- {
- InitializeComponent();
- Degree = 0;
- }
- }
- }
|