mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-22 07:10:40 +01:00
Kandinsky: Get rid of KDCoordinateMax
Which is annoying to handle, because once you define it you have to bother with additions overflowing... Change-Id: I50b19858342c5a2909e3078f1a4167be50210db1
This commit is contained in:
@@ -20,6 +20,7 @@ protected:
|
||||
virtual void logAttributes(std::ostream &os) const override;
|
||||
#endif
|
||||
private:
|
||||
void setContentViewOrigin();
|
||||
KDPoint m_offset;
|
||||
View * m_contentView;
|
||||
ScrollViewIndicator m_verticalScrollIndicator;
|
||||
|
||||
@@ -51,12 +51,7 @@ void ScrollView::layoutSubviews() {
|
||||
m_verticalScrollIndicator.setFrame(verticalIndicatorFrame);
|
||||
|
||||
// Layout contentview
|
||||
KDRect contentFrame;
|
||||
contentFrame.origin = m_offset;
|
||||
//contentFrame.size = m_contentView->bounds().size;
|
||||
contentFrame.width = KDCoordinateMax;
|
||||
contentFrame.height = KDCoordinateMax;
|
||||
m_contentView->setFrame(contentFrame);
|
||||
setContentViewOrigin();
|
||||
}
|
||||
|
||||
void ScrollView::setContentOffset(KDPoint offset) {
|
||||
@@ -72,6 +67,13 @@ void ScrollView::setContentOffset(KDPoint offset) {
|
||||
markAsNeedingRedraw();
|
||||
}
|
||||
|
||||
void ScrollView::setContentViewOrigin() {
|
||||
KDRect contentFrame;
|
||||
contentFrame.origin = m_offset;
|
||||
contentFrame.size = m_contentView->bounds().size;
|
||||
m_contentView->setFrame(contentFrame);
|
||||
}
|
||||
|
||||
#if ESCHER_VIEW_LOGGING
|
||||
const char * ScrollView::className() const {
|
||||
return "ScrollView";
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <stdint.h>
|
||||
|
||||
typedef int16_t KDCoordinate;
|
||||
#define KDCoordinateMax ((KDCoordinate)((1<<15)-1))
|
||||
|
||||
typedef struct {
|
||||
KDCoordinate x;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include <kandinsky/drawing_area.h>
|
||||
#include <ion.h>
|
||||
|
||||
KDRect KDDrawingArea = {
|
||||
.x = 0,
|
||||
.y = 0,
|
||||
.width = KDCoordinateMax,
|
||||
.height = KDCoordinateMax
|
||||
.width = ION_SCREEN_WIDTH,
|
||||
.height = ION_SCREEN_HEIGHT
|
||||
};
|
||||
|
||||
void KDSetDrawingArea(KDRect rect) {
|
||||
|
||||
Reference in New Issue
Block a user