Browse Source

Drop TALL_FONT_CORRECTION

Scott Lahteine 6 years ago
parent
commit
774a6e8199

+ 9
- 9
Marlin/src/lcd/dogm/status_screen_DOGM.h View File

@@ -285,15 +285,15 @@ void lcd_impl_status_screen_0() {
285 285
     //
286 286
     // SD Card Symbol
287 287
     //
288
-    if (card.isFileOpen() && PAGE_CONTAINS(42 - (TALL_FONT_CORRECTION), 51 - (TALL_FONT_CORRECTION))) {
288
+    if (card.isFileOpen() && PAGE_CONTAINS(42, 51)) {
289 289
       // Upper box
290
-      u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7);     // 42-48 (or 41-47)
290
+      u8g.drawBox(42, 42, 8, 7);     // 42-48 (or 41-47)
291 291
       // Right edge
292
-      u8g.drawBox(50, 44 - (TALL_FONT_CORRECTION), 2, 5);     // 44-48 (or 43-47)
292
+      u8g.drawBox(50, 44, 2, 5);     // 44-48 (or 43-47)
293 293
       // Bottom hollow box
294
-      u8g.drawFrame(42, 49 - (TALL_FONT_CORRECTION), 10, 4);  // 49-52 (or 48-51)
294
+      u8g.drawFrame(42, 49, 10, 4);  // 49-52 (or 48-51)
295 295
       // Corner pixel
296
-      u8g.drawPixel(50, 43 - (TALL_FONT_CORRECTION));         // 43 (or 42)
296
+      u8g.drawPixel(50, 43);         // 43 (or 42)
297 297
     }
298 298
   #endif // SDSUPPORT
299 299
 
@@ -304,10 +304,10 @@ void lcd_impl_status_screen_0() {
304 304
     #define PROGRESS_BAR_X 54
305 305
     #define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X)
306 306
 
307
-    if (PAGE_CONTAINS(49, 52 - (TALL_FONT_CORRECTION)))       // 49-52 (or 49-51)
307
+    if (PAGE_CONTAINS(49, 52))       // 49-52 (or 49-51)
308 308
       u8g.drawFrame(
309 309
         PROGRESS_BAR_X, 49,
310
-        PROGRESS_BAR_WIDTH, 4 - (TALL_FONT_CORRECTION)
310
+        PROGRESS_BAR_WIDTH, 4
311 311
       );
312 312
 
313 313
     #if DISABLED(LCD_SET_PROGRESS_MANUALLY)
@@ -320,10 +320,10 @@ void lcd_impl_status_screen_0() {
320 320
       // Progress bar solid part
321 321
       //
322 322
 
323
-      if (PAGE_CONTAINS(50, 51 - (TALL_FONT_CORRECTION)))     // 50-51 (or just 50)
323
+      if (PAGE_CONTAINS(50, 51))     // 50-51 (or just 50)
324 324
         u8g.drawBox(
325 325
           PROGRESS_BAR_X + 1, 50,
326
-          (uint16_t)((PROGRESS_BAR_WIDTH - 2) * progress_bar_percent * 0.01), 2 - (TALL_FONT_CORRECTION)
326
+          (uint16_t)((PROGRESS_BAR_WIDTH - 2) * progress_bar_percent * 0.01), 2
327 327
         );
328 328
 
329 329
       //

+ 5
- 10
Marlin/src/lcd/dogm/ultralcd_impl_DOGM.cpp View File

@@ -96,10 +96,6 @@
96 96
   #define DOG_CHAR_HEIGHT_EDIT DOG_CHAR_HEIGHT
97 97
 #endif
98 98
 
99
-#ifndef TALL_FONT_CORRECTION
100
-  #define TALL_FONT_CORRECTION 0
101
-#endif
102
-
103 99
 #define START_COL              0
104 100
 
105 101
 U8G_CLASS u8g(U8G_PARAM);
@@ -294,13 +290,12 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
294 290
 #if ENABLED(ULTIPANEL)
295 291
 
296 292
   uint8_t row_y1, row_y2;
297
-  uint8_t constexpr row_height = DOG_CHAR_HEIGHT + 2 * (TALL_FONT_CORRECTION);
298 293
 
299 294
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
300 295
 
301 296
     void lcd_implementation_hotend_status(const uint8_t row, const uint8_t extruder) {
302
-      row_y1 = row * row_height + 1;
303
-      row_y2 = row_y1 + row_height - 1;
297
+      row_y1 = row * (DOG_CHAR_HEIGHT) + 1;
298
+      row_y2 = row_y1 + DOG_CHAR_HEIGHT - 1;
304 299
 
305 300
       if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return;
306 301
 
@@ -319,8 +314,8 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
319 314
 
320 315
   // Set the colors for a menu item based on whether it is selected
321 316
   static bool mark_as_selected(const uint8_t row, const bool isSelected) {
322
-    row_y1 = row * row_height + 1;
323
-    row_y2 = row_y1 + row_height - 1;
317
+    row_y1 = row * (DOG_CHAR_HEIGHT) + 1;
318
+    row_y2 = row_y1 + DOG_CHAR_HEIGHT - 1;
324 319
 
325 320
     if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return false;
326 321
 
@@ -330,7 +325,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
330 325
         u8g.drawHLine(0, row_y2 + 2, LCD_PIXEL_WIDTH);
331 326
       #else
332 327
         u8g.setColorIndex(1); // black on white
333
-        u8g.drawBox(0, row_y1 + 2, LCD_PIXEL_WIDTH, row_height - 1);
328
+        u8g.drawBox(0, row_y1 + 2, LCD_PIXEL_WIDTH, DOG_CHAR_HEIGHT - 1);
334 329
         u8g.setColorIndex(0); // white on black
335 330
       #endif
336 331
     }

+ 0
- 2
Marlin/src/lcd/language/language_zh_CN.h View File

@@ -30,8 +30,6 @@
30 30
 #ifndef LANGUAGE_ZH_CN_H
31 31
 #define LANGUAGE_ZH_CN_H
32 32
 
33
-//#define TALL_FONT_CORRECTION (1)
34
-
35 33
 #define CHARSIZE 3
36 34
 
37 35
 #define WELCOME_MSG                         MACHINE_NAME _UxGT("已就绪.")  //" ready."

+ 0
- 2
Marlin/src/lcd/language/language_zh_TW.h View File

@@ -30,8 +30,6 @@
30 30
 #ifndef LANGUAGE_ZH_TW_H
31 31
 #define LANGUAGE_ZH_TW_H
32 32
 
33
-//#define TALL_FONT_CORRECTION (1)
34
-
35 33
 #define CHARSIZE 3
36 34
 
37 35
 #define WELCOME_MSG                         MACHINE_NAME _UxGT("已就緒.")  //" ready."

+ 2
- 7
Marlin/src/lcd/menu/menu.cpp View File

@@ -101,12 +101,7 @@ bool liveEdit;
101 101
   float raw_Ki, raw_Kd; // place-holders for Ki and Kd edits
102 102
 #endif
103 103
 
104
-#ifndef TALL_FONT_CORRECTION
105
-  #define TALL_FONT_CORRECTION 0
106
-#endif
107
-
108 104
 bool no_reentry = false;
109
-constexpr int8_t menu_bottom = LCD_HEIGHT - (TALL_FONT_CORRECTION);
110 105
 
111 106
 // Initialized by settings.load()
112 107
 int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2];
@@ -478,8 +473,8 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
478 473
   }
479 474
   if (is_menu) {
480 475
     NOMORE(encoderTopLine, encoderLine);
481
-    if (encoderLine >= encoderTopLine + menu_bottom)
482
-      encoderTopLine = encoderLine - menu_bottom + 1;
476
+    if (encoderLine >= encoderTopLine + LCD_HEIGHT)
477
+      encoderTopLine = encoderLine - LCD_HEIGHT + 1;
483 478
   }
484 479
   else
485 480
     encoderTopLine = encoderLine;

+ 2
- 2
Marlin/src/lcd/menu/menu.h View File

@@ -179,7 +179,7 @@ void menu_action_setting_edit_callback_bool(PGM_P pstr, bool* ptr, screenFunc_t
179 179
  */
180 180
 #define SCREEN_OR_MENU_LOOP() \
181 181
   int8_t _menuLineNr = encoderTopLine, _thisItemNr; \
182
-  for (int8_t _lcdLineNr = 0; _lcdLineNr < menu_bottom; _lcdLineNr++, _menuLineNr++) { \
182
+  for (int8_t _lcdLineNr = 0; _lcdLineNr < LCD_HEIGHT; _lcdLineNr++, _menuLineNr++) { \
183 183
     _thisItemNr = 0
184 184
 
185 185
 /**
@@ -190,7 +190,7 @@ void menu_action_setting_edit_callback_bool(PGM_P pstr, bool* ptr, screenFunc_t
190 190
  *               Scroll as-needed to keep the selected line in view.
191 191
  */
192 192
 #define START_SCREEN() \
193
-  scroll_screen(menu_bottom, false); \
193
+  scroll_screen(LCD_HEIGHT, false); \
194 194
   bool _skipStatic = false; \
195 195
   SCREEN_OR_MENU_LOOP()
196 196
 

+ 2
- 2
Marlin/src/lcd/ultralcd.h View File

@@ -210,8 +210,8 @@
210 210
   #endif
211 211
 
212 212
   #if ENABLED(DOGLCD)
213
-    #define SETCURSOR(col, row) lcd_moveto(col * (DOG_CHAR_WIDTH), (row + 1) * row_height)
214
-    #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_PIXEL_WIDTH - len * (DOG_CHAR_WIDTH), (row + 1) * row_height)
213
+    #define SETCURSOR(col, row) lcd_moveto(col * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT))
214
+    #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_PIXEL_WIDTH - len * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT))
215 215
   #else
216 216
     #define SETCURSOR(col, row) lcd_moveto(col, row)
217 217
     #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_WIDTH - len, row)

Loading…
Cancel
Save