mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[kandinsky] Add a default font size : large
Change-Id: I6b9f1a7b09292f120074c8957e328ddc33023c67
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
namespace Calculation {
|
||||
|
||||
TextField::TextField(Responder * parentResponder, char * textBuffer, size_t textBufferSize, TextFieldDelegate * delegate) :
|
||||
::TextField(parentResponder, textBuffer, textBuffer, textBufferSize, KDText::FontSize::Large, delegate)
|
||||
::TextField(parentResponder, textBuffer, textBuffer, textBufferSize, delegate)
|
||||
{
|
||||
m_isEditing = true;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ void CurveView::drawLabels(KDContext * ctx, KDRect rect, Axis axis, bool shiftOr
|
||||
origin = KDPoint(floatToPixel(Axis::Horizontal, 0.0f) + k_labelMargin, floatToPixel(Axis::Vertical, 0.0f) + k_labelMargin);
|
||||
}
|
||||
if (rect.intersects(KDRect(origin, KDText::stringSize(label(axis, i), KDText::FontSize::Small)))) {
|
||||
ctx->blendString(label(axis, i), KDText::FontSize::Small, origin, KDColorBlack);
|
||||
ctx->blendString(label(axis, i), origin, KDText::FontSize::Small, KDColorBlack);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ public:
|
||||
HorizontalIndicator,
|
||||
VerticalIndicator
|
||||
};
|
||||
FunctionTitleCell(Orientation orientation, KDText::FontSize size);
|
||||
FunctionTitleCell(Orientation orientation, KDText::FontSize size = KDText::FontSize::Small);
|
||||
void setColor(KDColor color);
|
||||
void setText(const char * textContent);
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Graph {
|
||||
ListController::ListController(Responder * parentResponder, FunctionStore * functionStore, HeaderViewController * header) :
|
||||
ViewController(parentResponder),
|
||||
HeaderViewDelegate(header),
|
||||
m_functionTitleCells{FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator, KDText::FontSize::Large), FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator, KDText::FontSize::Large), FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator, KDText::FontSize::Large),
|
||||
FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator, KDText::FontSize::Large), FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator, KDText::FontSize::Large), FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator, KDText::FontSize::Large)},
|
||||
m_functionTitleCells{FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator), FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator), FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator),
|
||||
FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator), FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator), FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator)},
|
||||
m_selectableTableView(SelectableTableView(this, this, 0, 0, 0, 0, nullptr, false, true)),
|
||||
m_functionStore(functionStore),
|
||||
m_parameterController(ParameterController(this, functionStore))
|
||||
@@ -48,7 +48,7 @@ KDCoordinate ListController::rowHeight(int j) {
|
||||
return k_emptyRowHeight;
|
||||
}
|
||||
KDCoordinate functionSize = function->layout()->size().height();
|
||||
return functionSize + k_emptyRowHeight - KDText::stringSize(" ", KDText::FontSize::Large).height();
|
||||
return functionSize + k_emptyRowHeight - KDText::stringSize(" ").height();
|
||||
}
|
||||
|
||||
KDCoordinate ListController::columnWidth(int i) {
|
||||
|
||||
@@ -11,10 +11,9 @@ namespace Probability {
|
||||
CalculationController::ContentView::ContentView(Responder * parentResponder, CalculationController * calculationController, Calculation * calculation) :
|
||||
m_lawCurveView(LawCurveView()),
|
||||
m_imageTableView(ImageTableView(parentResponder, calculation, calculationController)),
|
||||
m_text{PointerTextView(KDText::FontSize::Large), PointerTextView(KDText::FontSize::Large), PointerTextView(KDText::FontSize::Large)},
|
||||
m_calculationCell{EditableTextCell(parentResponder, calculationController, m_draftTextBuffer, KDText::FontSize::Large),
|
||||
EditableTextCell(parentResponder, calculationController, m_draftTextBuffer, KDText::FontSize::Large),
|
||||
EditableTextCell(parentResponder, calculationController, m_draftTextBuffer, KDText::FontSize::Large)},
|
||||
m_calculationCell{EditableTextCell(parentResponder, calculationController, m_draftTextBuffer),
|
||||
EditableTextCell(parentResponder, calculationController, m_draftTextBuffer),
|
||||
EditableTextCell(parentResponder, calculationController, m_draftTextBuffer)},
|
||||
m_calculation(calculation)
|
||||
{
|
||||
}
|
||||
@@ -70,7 +69,7 @@ void CalculationController::ContentView::willDisplayEditableCellAtIndex(int inde
|
||||
|
||||
void CalculationController::ContentView::layoutSubviews() {
|
||||
markRectAsDirty(bounds());
|
||||
KDSize charSize = KDText::stringSize(" ", KDText::FontSize::Large);
|
||||
KDSize charSize = KDText::stringSize(" ");
|
||||
KDCoordinate xCoordinate = 0;
|
||||
m_lawCurveView.setFrame(KDRect(0, ImageTableView::k_imageHeight, bounds().width(), bounds().height() - ImageTableView::k_imageHeight));
|
||||
m_imageTableView.setFrame(KDRect(xCoordinate, 0, ImageTableView::k_imageWidth, 3*ImageTableView::k_imageHeight));
|
||||
|
||||
@@ -14,7 +14,7 @@ HistogramController::HistogramController(Responder * parentResponder, HeaderView
|
||||
HistogramController * histogramController = (HistogramController *) context;
|
||||
StackViewController * stack = ((StackViewController *)histogramController->stackController());
|
||||
stack->push(histogramController->histogramParameterController());
|
||||
}, this), KDText::FontSize::Small)),
|
||||
}, this))),
|
||||
m_store(store),
|
||||
m_cursor(CurveViewCursor()),
|
||||
m_histogramParameterController(nullptr, store)
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
StoreController::StoreController(Responder * parentResponder, FloatPairStore * store, HeaderViewController * header) :
|
||||
EditableCellTableViewController(parentResponder, Metric::TopMargin, Metric::RightMargin, Metric::BottomMargin, Metric::LeftMargin),
|
||||
HeaderViewDelegate(header),
|
||||
m_editableCells{EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large),
|
||||
EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large),
|
||||
EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large),
|
||||
EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large),
|
||||
EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer, KDText::FontSize::Large)},
|
||||
m_editableCells{EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer),
|
||||
EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer),
|
||||
EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer),
|
||||
EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer),
|
||||
EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer), EvenOddEditableTextCell(&m_selectableTableView, this, m_draftTextBuffer)},
|
||||
m_store(store),
|
||||
m_storeParameterController(this, store)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
class BufferTextView : public TextView {
|
||||
public:
|
||||
BufferTextView(KDText::FontSize size, float horizontalAlignment = 0.5f, float verticalAlignment = 0.5f,
|
||||
BufferTextView(KDText::FontSize size = KDText::FontSize::Large, float horizontalAlignment = 0.5f, float verticalAlignment = 0.5f,
|
||||
KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite);
|
||||
void setText(const char * text) override;
|
||||
const char * text() const override;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
class Button : public View, public Responder {
|
||||
public:
|
||||
Button(Responder * parentResponder, const char * textBody, Invocation invocation, KDText::FontSize size);
|
||||
Button(Responder * parentResponder, const char * textBody, Invocation invocation, KDText::FontSize size = KDText::FontSize::Small);
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
void setBackgroundColor(KDColor backgroundColor);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
class EditableTextCell : public TableViewCell, public Responder {
|
||||
public:
|
||||
EditableTextCell(Responder * parentResponder, TextFieldDelegate * delegate, char * draftTextBuffer, KDText::FontSize size,
|
||||
EditableTextCell(Responder * parentResponder, TextFieldDelegate * delegate, char * draftTextBuffer, KDText::FontSize size = KDText::FontSize::Large,
|
||||
float horizontalAlignment = 0.0f, float verticalAlignment = 0.5f, KDColor textColor = KDColorBlack, KDColor = KDColorWhite);
|
||||
TextField * textField();
|
||||
void reloadCell() override;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
class EvenOddEditableTextCell : public EvenOddCell, public Responder {
|
||||
public:
|
||||
EvenOddEditableTextCell(Responder * parentResponder, TextFieldDelegate * delegate, char * draftTextBuffer, KDText::FontSize size);
|
||||
EvenOddEditableTextCell(Responder * parentResponder, TextFieldDelegate * delegate, char * draftTextBuffer, KDText::FontSize size = KDText::FontSize::Large);
|
||||
EditableTextCell * editableTextCell();
|
||||
void reloadCell() override;
|
||||
const char * text() const;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
class EvenOddPointerTextCell : public EvenOddCell {
|
||||
public:
|
||||
EvenOddPointerTextCell(KDText::FontSize size);
|
||||
EvenOddPointerTextCell(KDText::FontSize size = KDText::FontSize::Large);
|
||||
void reloadCell() override;
|
||||
void setText(const char * textContent, KDColor textColor = KDColorBlack);
|
||||
void setAlignment(float horizontalAlignment, float verticalAlignment);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
class PointerTextView : public TextView {
|
||||
public:
|
||||
PointerTextView(KDText::FontSize size, const char * text = nullptr, float horizontalAlignment = 0.0f, float verticalAlignment = 0.0f,
|
||||
PointerTextView(KDText::FontSize size = KDText::FontSize::Large, const char * text = nullptr, float horizontalAlignment = 0.0f, float verticalAlignment = 0.0f,
|
||||
KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite);
|
||||
void setText(const char * text) override;
|
||||
protected:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
class TextField : public View, public Responder {
|
||||
public:
|
||||
TextField(Responder * parentResponder, char * textBuffer, char * draftTextBuffer, size_t textBufferSize,
|
||||
KDText::FontSize size, TextFieldDelegate * delegate = nullptr, float horizontalAlignment = 0.0f,
|
||||
TextFieldDelegate * delegate = nullptr, KDText::FontSize size = KDText::FontSize::Large, float horizontalAlignment = 0.0f,
|
||||
float verticalAlignment = 0.5f, KDColor textColor = KDColorBlack, KDColor = KDColorWhite);
|
||||
// View
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
|
||||
@@ -9,7 +9,7 @@ public:
|
||||
// alignment = 0 -> align left or top
|
||||
// alignment = 0.5 -> align center
|
||||
// alignment = 1.0 -> align right or bottom
|
||||
TextView(KDText::FontSize size, float horizontalAlignment = 0.0f, float verticalAlignment = 0.0f,
|
||||
TextView(KDText::FontSize size = KDText::FontSize::Large, float horizontalAlignment = 0.0f, float verticalAlignment = 0.0f,
|
||||
KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite);
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
void setBackgroundColor(KDColor backgroundColor);
|
||||
|
||||
@@ -7,7 +7,7 @@ EditableTextCell::EditableTextCell(Responder * parentResponder, TextFieldDelegat
|
||||
KDText::FontSize size, float horizontalAlignment, float verticalAlignment, KDColor textColor, KDColor backgroundColor) :
|
||||
TableViewCell(),
|
||||
Responder(parentResponder),
|
||||
m_textField(TextField(this, m_textBody, draftTextBuffer, 255, size, delegate, horizontalAlignment, verticalAlignment, textColor, backgroundColor))
|
||||
m_textField(TextField(this, m_textBody, draftTextBuffer, 255, delegate, size, horizontalAlignment, verticalAlignment, textColor, backgroundColor))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
EditableTextMenuListCell::EditableTextMenuListCell(Responder * parentResponder, TextFieldDelegate * textFieldDelegate, char * draftTextBuffer, char * label) :
|
||||
Responder(parentResponder),
|
||||
MenuListCell(label),
|
||||
m_textField(TextField(this, m_textBody, draftTextBuffer, 255, KDText::FontSize::Large, textFieldDelegate, 1.0f, 0.5f))
|
||||
m_textField(TextField(this, m_textBody, draftTextBuffer, 255, textFieldDelegate, KDText::FontSize::Large, 1.0f, 0.5f))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ void EditableTextMenuListCell::layoutSubviews() {
|
||||
MenuListCell::layoutSubviews();
|
||||
KDCoordinate width = bounds().width();
|
||||
KDCoordinate height = bounds().height();
|
||||
KDSize charSize = KDText::stringSize(" ", KDText::FontSize::Large);
|
||||
KDSize charSize = KDText::stringSize(" ");
|
||||
KDCoordinate textWidth = k_maxNumberOfEditableCharacters*charSize.width();
|
||||
m_textField.setFrame(KDRect(width - textWidth - k_separatorThickness, (height - charSize.height())/2, textWidth - k_separatorThickness, charSize.height()));
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
InputViewController::TextFieldController::TextFieldController(Responder * parentResponder, TextFieldDelegate * textFieldDelegate) :
|
||||
ViewController(parentResponder),
|
||||
m_textField(parentResponder, m_textBody, m_textBody, 255, KDText::FontSize::Large, textFieldDelegate)
|
||||
m_textField(parentResponder, m_textBody, m_textBody, 255, textFieldDelegate)
|
||||
{
|
||||
m_textBody[0] = 0;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ void TabViewCell::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
// Write title
|
||||
KDSize textSize = KDText::stringSize(m_name, KDText::FontSize::Small);
|
||||
KDPoint origin(0.5f*(m_frame.width() - textSize.width()),0.5f*(m_frame.height() - textSize.height()));
|
||||
ctx->drawString(m_name, KDText::FontSize::Small, origin, text, background);
|
||||
ctx->drawString(m_name, origin, KDText::FontSize::Small, text, background);
|
||||
}
|
||||
|
||||
#if ESCHER_VIEW_LOGGING
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <assert.h>
|
||||
|
||||
TextField::TextField(Responder * parentResponder, char * textBuffer, char * draftTextBuffer,
|
||||
size_t textBufferSize, KDText::FontSize size, TextFieldDelegate * delegate,
|
||||
size_t textBufferSize, TextFieldDelegate * delegate, KDText::FontSize size,
|
||||
float horizontalAlignment, float verticalAlignment, KDColor textColor, KDColor backgroundColor) :
|
||||
View(),
|
||||
Responder(parentResponder),
|
||||
@@ -33,7 +33,7 @@ void TextField::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
KDSize textSize = KDText::stringSize(text(), m_fontSize);
|
||||
KDPoint origin(m_horizontalAlignment*(m_frame.width() - textSize.width()),
|
||||
m_verticalAlignment*(m_frame.height() - textSize.height()));
|
||||
ctx->drawString(text(), m_fontSize, origin, m_textColor, m_backgroundColor);
|
||||
ctx->drawString(text(), origin, m_fontSize, m_textColor, m_backgroundColor);
|
||||
}
|
||||
|
||||
#if ESCHER_VIEW_LOGGING
|
||||
|
||||
@@ -39,7 +39,7 @@ void TextView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
KDPoint origin(m_horizontalAlignment*(m_frame.width() - textSize.width()),
|
||||
m_verticalAlignment*(m_frame.height() - textSize.height()));
|
||||
ctx->fillRect(bounds(), m_backgroundColor);
|
||||
ctx->drawString(text(), m_fontSize, origin, m_textColor, m_backgroundColor);
|
||||
ctx->drawString(text(), origin, m_fontSize, m_textColor, m_backgroundColor);
|
||||
}
|
||||
|
||||
#if ESCHER_VIEW_LOGGING
|
||||
|
||||
@@ -15,10 +15,10 @@ public:
|
||||
KDColor getPixel(KDPoint p);
|
||||
|
||||
// Text
|
||||
void drawChar(char character, KDText::FontSize size, KDPoint p, KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite);
|
||||
void drawString(const char * text, KDText::FontSize size, KDPoint p, KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite);
|
||||
void blendChar(char character, KDText::FontSize size, KDPoint p, KDColor textColor = KDColorBlack);
|
||||
void blendString(const char * text, KDText::FontSize size, KDPoint p, KDColor textColor = KDColorBlack);
|
||||
void drawChar(char character, KDPoint p, KDText::FontSize size = KDText::FontSize::Large, KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite);
|
||||
void drawString(const char * text, KDPoint p, KDText::FontSize size = KDText::FontSize::Large, KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite);
|
||||
void blendChar(char character, KDPoint p, KDText::FontSize size, KDColor textColor = KDColorBlack);
|
||||
void blendString(const char * text, KDPoint p, KDText::FontSize size, KDColor textColor = KDColorBlack);
|
||||
|
||||
// Line. Not anti-aliased.
|
||||
void drawLine(KDPoint p1, KDPoint p2, KDColor c);
|
||||
|
||||
@@ -9,7 +9,7 @@ public:
|
||||
Small,
|
||||
Large
|
||||
};
|
||||
static KDSize stringSize(const char * text, FontSize size);
|
||||
static KDSize stringSize(const char * text, FontSize size = FontSize::Large);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
KDColor smallCharacterBuffer[BITMAP_SmallFont_CHARACTER_WIDTH*BITMAP_SmallFont_CHARACTER_HEIGHT];
|
||||
KDColor largeCharacterBuffer[BITMAP_LargeFont_CHARACTER_WIDTH*BITMAP_LargeFont_CHARACTER_HEIGHT];
|
||||
|
||||
void KDContext::drawChar(char character, KDText::FontSize size, KDPoint p, KDColor textColor, KDColor backgroundColor) {
|
||||
void KDContext::drawChar(char character, KDPoint p, KDText::FontSize size, KDColor textColor, KDColor backgroundColor) {
|
||||
char firstCharacter = size == KDText::FontSize::Large ? BITMAP_LargeFont_FIRST_ASCII_CHARACTER : BITMAP_SmallFont_FIRST_ASCII_CHARACTER;
|
||||
int characterHeight = size == KDText::FontSize::Large ? BITMAP_LargeFont_CHARACTER_HEIGHT : BITMAP_SmallFont_CHARACTER_HEIGHT;
|
||||
int characterWidth = size == KDText::FontSize::Large ? BITMAP_LargeFont_CHARACTER_WIDTH : BITMAP_SmallFont_CHARACTER_WIDTH;
|
||||
@@ -27,18 +27,18 @@ void KDContext::drawChar(char character, KDText::FontSize size, KDPoint p, KDCol
|
||||
characterBuffer);
|
||||
}
|
||||
|
||||
void KDContext::drawString(const char * text, KDText::FontSize size, KDPoint p, KDColor textColor, KDColor backgroundColor) {
|
||||
void KDContext::drawString(const char * text, KDPoint p, KDText::FontSize size, KDColor textColor, KDColor backgroundColor) {
|
||||
KDPoint position = p;
|
||||
int characterWidth = size == KDText::FontSize::Large ? BITMAP_LargeFont_CHARACTER_WIDTH : BITMAP_SmallFont_CHARACTER_WIDTH;
|
||||
KDPoint characterSize(characterWidth, 0);
|
||||
while(*text != 0) {
|
||||
drawChar(*text, size, position, textColor, backgroundColor);
|
||||
drawChar(*text, position, size, textColor, backgroundColor);
|
||||
text++;
|
||||
position = position.translatedBy(characterSize);
|
||||
}
|
||||
}
|
||||
|
||||
void KDContext::blendChar(char character, KDText::FontSize size, KDPoint p, KDColor textColor) {
|
||||
void KDContext::blendChar(char character, KDPoint p, KDText::FontSize size, KDColor textColor) {
|
||||
int firstCharacter = size == KDText::FontSize::Large ? BITMAP_LargeFont_FIRST_ASCII_CHARACTER : BITMAP_SmallFont_FIRST_ASCII_CHARACTER;
|
||||
int characterHeight = size == KDText::FontSize::Large ? BITMAP_LargeFont_CHARACTER_HEIGHT : BITMAP_SmallFont_CHARACTER_HEIGHT;
|
||||
int characterWidth = size == KDText::FontSize::Large ? BITMAP_LargeFont_CHARACTER_WIDTH : BITMAP_SmallFont_CHARACTER_WIDTH;
|
||||
@@ -65,12 +65,12 @@ void KDContext::blendChar(char character, KDText::FontSize size, KDPoint p, KDCo
|
||||
pushRect(absoluteRect, characterBuffer);
|
||||
}
|
||||
|
||||
void KDContext::blendString(const char * text, KDText::FontSize size, KDPoint p, KDColor textColor) {
|
||||
void KDContext::blendString(const char * text, KDPoint p, KDText::FontSize size, KDColor textColor) {
|
||||
KDPoint position = p;
|
||||
int characterWidth = size == KDText::FontSize::Large ? BITMAP_LargeFont_CHARACTER_WIDTH : BITMAP_SmallFont_CHARACTER_WIDTH;
|
||||
KDPoint characterSize(characterWidth, 0);
|
||||
while(*text != 0) {
|
||||
blendChar(*text, size, position, textColor);
|
||||
blendChar(*text, position, size, textColor);
|
||||
text++;
|
||||
position = position.translatedBy(characterSize);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ ExpressionLayout(), m_numerator_layout(numerator_layout), m_denominator_layout(d
|
||||
m_denominator_layout->setParent(this);
|
||||
m_baseline = m_numerator_layout->size().height()
|
||||
+ k_fractionLineMargin
|
||||
+ KDText::stringSize(" ", KDText::FontSize::Large).height()/2;
|
||||
+ KDText::stringSize(" ").height()/2;
|
||||
}
|
||||
|
||||
FractionLayout::~FractionLayout() {
|
||||
|
||||
@@ -13,7 +13,7 @@ MatrixLayout::MatrixLayout(ExpressionLayout ** entryLayouts, int numberOfRows, i
|
||||
for (int i = 0; i < m_numberOfRows*m_numberOfColumns; i++) {
|
||||
m_entryLayouts[i]->setParent(this);
|
||||
}
|
||||
m_baseline = height()/2 + KDText::stringSize(" ", KDText::FontSize::Large).height()/2;
|
||||
m_baseline = height()/2 + KDText::stringSize(" ").height()/2;
|
||||
}
|
||||
|
||||
MatrixLayout::~MatrixLayout() {
|
||||
|
||||
@@ -22,7 +22,7 @@ ExpressionLayout * StringLayout::child(uint16_t index) {
|
||||
}
|
||||
|
||||
void StringLayout::render(KDContext * ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor) {
|
||||
ctx->drawString(m_string, m_fontSize, p, expressionColor, backgroundColor);
|
||||
ctx->drawString(m_string, p, m_fontSize, expressionColor, backgroundColor);
|
||||
}
|
||||
|
||||
KDPoint StringLayout::positionOfChild(ExpressionLayout * child) {
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
void print(const char * message) {
|
||||
static int line_y = 0;
|
||||
KDContext * ctx = KDIonContext::sharedContext();
|
||||
int line_height = KDText::stringSize("M", KDText::FontSize::Large).height();
|
||||
ctx->drawString(message, KDText::FontSize::Large, KDPoint(0, line_y), KDColorBlack);
|
||||
int line_height = KDText::stringSize("M").height();
|
||||
ctx->drawString(message, KDPoint(0, line_y));
|
||||
line_y += line_height;
|
||||
if (line_y > Ion::Display::Height) {
|
||||
line_y = 0;
|
||||
|
||||
Reference in New Issue
Block a user