Bless.Gui.Areas.Plugins.GroupedArea.GetOffsetByDisplayInfo C# (CSharp) Method

GetOffsetByDisplayInfo() public method

public GetOffsetByDisplayInfo ( int x, int y, int &digit, GetOffsetFlags &flags ) : long
x int
y int
digit int
flags GetOffsetFlags
return long
	public override long GetOffsetByDisplayInfo(int x, int y, out int digit, out GetOffsetFlags flags)
	{
		flags = 0;
		int groupWidth = (grouping * dpb * drawer.Width + drawer.Width);

		int row = y / drawer.Height;
		int group = x / groupWidth;
		int groupByte = (x - group * groupWidth) / (dpb * drawer.Width);

		digit = (x - group * groupWidth - groupByte * dpb * drawer.Width) / drawer.Width;

		if (groupByte >= grouping) {
			groupByte = grouping - 1;
			flags |= GetOffsetFlags.Abyss;
		}

		long off = row * bpr + (group * grouping + groupByte) + areaGroup.Offset;
		if (off >= areaGroup.Buffer.Size)
			flags |= GetOffsetFlags.Eof;

		return off;

	}