# Path: src/model/resources_cache.py
# class ResourcesCache(object):
#     _resources = {}
# 
#     @staticmethod
#     def get(name):
#         return ResourcesCache._resources[name]
# 
#     @staticmethod
#     def register_resource(name, resource):
#         ResourcesCache._resources[name] = resource
# 
#     @staticmethod
#     def dispose():
#         ResourcesCache._resources.clear()


import math
import src.helpers.utils as utils
from PyQt5.QtCore import Qt, QSize, pyqtSignal, QRect
from PyQt5.QtGui import QIcon, QPixmap, QPen, QPainter, QColor
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QComboBox, \
    QLabel, QPushButton
from src.model.resources_cache import ResourcesCache

        excedent_frames = self._sprite.current_animation.frame_count - self._maxFramesOnView

        if excedent_frames < 0:
            excedent_frames = 0

        total_frame_size = self._frameSize + 2 * self._framePadding

        if delta > 0:

            self._horizontalShift += total_frame_size

            if self._horizontalShift > excedent_frames * total_frame_size:
                self._horizontalShift = excedent_frames * total_frame_size

            self.update()

        elif delta < 0:

            self._horizontalShift -= self._frameSize + 2 * self._framePadding

            if self._horizontalShift < -excedent_frames * total_frame_size + excedent_frames * \
                    total_frame_size:
                self._horizontalShift = -excedent_frames * total_frame_size + excedent_frames * \
                    total_frame_size

            self.update()

    def paintEvent(self, e):


# Path: src/model/resources_cache.py
# class ResourcesCache(object):
#     _resources = {}
# 
#     @staticmethod
#     def get(name):
#         return ResourcesCache._resources[name]
# 
#     @staticmethod
#     def register_resource(name, resource):
#         ResourcesCache._resources[name] = resource
# 
#     @staticmethod
#     def dispose():
#         ResourcesCache._resources.clear()


# Path: src/view/animation_manager_widget.py
import math
import src.helpers.utils as utils
from PyQt5.QtCore import Qt, QSize, pyqtSignal, QRect
from PyQt5.QtGui import QIcon, QPixmap, QPen, QPainter, QColor
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QComboBox, \
    QLabel, QPushButton
from src.model.resources_cache import ResourcesCache


        excedent_frames = self._sprite.current_animation.frame_count - self._maxFramesOnView

        if excedent_frames < 0:
            excedent_frames = 0

        total_frame_size = self._frameSize + 2 * self._framePadding

        if delta > 0:

            self._horizontalShift += total_frame_size

            if self._horizontalShift > excedent_frames * total_frame_size:
                self._horizontalShift = excedent_frames * total_frame_size

            self.update()

        elif delta < 0:

            self._horizontalShift -= self._frameSize + 2 * self._framePadding

            if self._horizontalShift < -excedent_frames * total_frame_size + excedent_frames * \
                    total_frame_size:
                self._horizontalShift = -excedent_frames * total_frame_size + excedent_frames * \
                    total_frame_size

            self.update()

    def paintEvent(self, e):


        p = QPainter(self)