summaryrefslogtreecommitdiff
path: root/platform/winrt/gsview/TextCharacter.cs
blob: b69cfbffc9da837bf5a33864defaa537111cf2cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using System.Threading.Tasks;
using System.ComponentModel;

namespace gsview
{
	public class TextCharacter
	{
		public String character;

		public double Height
		{
			get;
			set;
		}

		public double Width
		{
			get;
			set;
		}

		public double X
		{
			get;
			set;
		}

		public double Y
		{
			get;
			set;
		}

		public double Scale
		{
			get;
			set;
		}

		public String Color
		{
			get;
			set;
		}

		/* Here we only worry about intersection in the x direction TODO */
		public Intersection_t CheckIntersection(double rect_x, double rect_y, double rect_w, double rect_h)
		{
			if (rect_w == 0 || rect_x > X + Width  || rect_x + rect_w < X)
				return Intersection_t.NONE;

			if (rect_x <= X && X + Width <= rect_x + rect_w)
				return Intersection_t.FULL;

			return Intersection_t.PARTIAL;
		}


		//public event PropertyChangedEventHandler PropertyChanged;

		/*
		public void CharRefresh()
		{
			if (PropertyChanged != null)
			{
				PropertyChanged(this, new PropertyChangedEventArgs("X"));
				PropertyChanged(this, new PropertyChangedEventArgs("Height"));
				PropertyChanged(this, new PropertyChangedEventArgs("Width"));
				PropertyChanged(this, new PropertyChangedEventArgs("Y"));
				PropertyChanged(this, new PropertyChangedEventArgs("Color"));
			}
		}
		 * */
	}
}