From 3f5e3689fa2cbd75be1d42ee9c912665ff1b2887 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Mon, 28 May 2018 10:32:13 +0200 Subject: [PATCH] Update attributeManager.py --- src/fenrirscreenreader/core/attributeManager.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/fenrirscreenreader/core/attributeManager.py b/src/fenrirscreenreader/core/attributeManager.py index dd188455..7adb757e 100644 --- a/src/fenrirscreenreader/core/attributeManager.py +++ b/src/fenrirscreenreader/core/attributeManager.py @@ -11,6 +11,10 @@ class attributeManager(): def __init__(self): self.currAttributes = None self.prevAttributes = None + self.currAttribDelta = '' + self.prevAttribDelta = '' + self.currAttribCursor = None + self.prefAttribCursor = None self.setDefaultAttributes() def initialize(self, environment): self.env = environment @@ -19,6 +23,14 @@ class attributeManager(): def updateAttributeData(self, prevAttributes, currAttributes): self.prevAttributes = prevAttributes self.currAttributes = currAttributes + def getAttributeByXY(self, x, y): + if not self.currAttributes: + return None + if len(self.currAttributes) < y: + return None + if len(self.currAttributes[y]) < x: + return None + return self.currAttributes[y][x] def setDefaultAttributes(self): self.defaultAttributes = [] self.defaultAttributes.append((