Browse Source

crop support

Odilitime 5 years ago
parent
commit
6ed0da9548
  1. 2
      src/graphics/components/TextComponent.cpp
  2. 4
      src/graphics/components/TextComponent.h

2
src/graphics/components/TextComponent.cpp

@ -120,6 +120,8 @@ void TextComponent::rasterize(const int rawX, const int rawY) { @@ -120,6 +120,8 @@ void TextComponent::rasterize(const int rawX, const int rawY) {
request.availableWidth = this->availableWidth;
request.sourceStartX = this->rasterStartX;
request.sourceStartY = this->rasterStartY;
request.cropWidth = this->rasterCropX;
request.cropHeight = this->rasterCropY;
if (this->win) {
request.maxTextureSize = this->win->maxTextureSize & INT_MAX;
} // else called from input cstr, no win yet

4
src/graphics/components/TextComponent.h

@ -33,9 +33,11 @@ public: @@ -33,9 +33,11 @@ public:
void updateHighlight();
std::unique_ptr<sizeResponse> size() const;
// input needed stuff
// input needed stuff for scrollin
int rasterStartX = 0; // start reading text source at and place at destination 0
int rasterStartY = 0;
int rasterCropX = 0;
int rasterCropY = 0;
bool noWrap = false; // different than overflow but related
bool textSelected = false;
int availableWidth = 0;

Loading…
Cancel
Save