A fork of https://github.com/crosspoint-reader/crosspoint-reader
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: Skip negative screen coordinates only after we read the bitmap row. (#431)

Otherwise, we don't crop properly.

Fixes #430

### AI Usage

Did you use AI tools to help write this code? _**< NO >**_

authored by

Jonas Diemer and committed by
GitHub
cc74039c 87d6c032

+5 -4
+4 -3
lib/GfxRenderer/GfxRenderer.cpp
··· 201 201 if (screenY >= getScreenHeight()) { 202 202 break; 203 203 } 204 - if (screenY < 0) { 205 - continue; 206 - } 207 204 208 205 if (bitmap.readNextRow(outputRow, rowBytes) != BmpReaderError::Ok) { 209 206 Serial.printf("[%lu] [GFX] Failed to read row %d from bitmap\n", millis(), bmpY); 210 207 free(outputRow); 211 208 free(rowBytes); 212 209 return; 210 + } 211 + 212 + if (screenY < 0) { 213 + continue; 213 214 } 214 215 215 216 if (bmpY < cropPixY) {
+1 -1
src/activities/boot_sleep/SleepActivity.cpp
··· 167 167 Serial.printf("[%lu] [SLP] Cropping bitmap y: %f\n", millis(), cropY); 168 168 ratio = static_cast<float>(bitmap.getWidth()) / ((1.0f - cropY) * static_cast<float>(bitmap.getHeight())); 169 169 } 170 - x = std::round((pageWidth - pageHeight * ratio) / 2); 170 + x = std::round((static_cast<float>(pageWidth) - static_cast<float>(pageHeight) * ratio) / 2); 171 171 y = 0; 172 172 Serial.printf("[%lu] [SLP] Centering with ratio %f to x=%d\n", millis(), ratio, x); 173 173 }