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
     //
285
     //
286
     // SD Card Symbol
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
       // Upper box
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
       // Right edge
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
       // Bottom hollow box
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
       // Corner pixel
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
   #endif // SDSUPPORT
298
   #endif // SDSUPPORT
299
 
299
 
304
     #define PROGRESS_BAR_X 54
304
     #define PROGRESS_BAR_X 54
305
     #define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X)
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
       u8g.drawFrame(
308
       u8g.drawFrame(
309
         PROGRESS_BAR_X, 49,
309
         PROGRESS_BAR_X, 49,
310
-        PROGRESS_BAR_WIDTH, 4 - (TALL_FONT_CORRECTION)
310
+        PROGRESS_BAR_WIDTH, 4
311
       );
311
       );
312
 
312
 
313
     #if DISABLED(LCD_SET_PROGRESS_MANUALLY)
313
     #if DISABLED(LCD_SET_PROGRESS_MANUALLY)
320
       // Progress bar solid part
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
         u8g.drawBox(
324
         u8g.drawBox(
325
           PROGRESS_BAR_X + 1, 50,
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
   #define DOG_CHAR_HEIGHT_EDIT DOG_CHAR_HEIGHT
96
   #define DOG_CHAR_HEIGHT_EDIT DOG_CHAR_HEIGHT
97
 #endif
97
 #endif
98
 
98
 
99
-#ifndef TALL_FONT_CORRECTION
100
-  #define TALL_FONT_CORRECTION 0
101
-#endif
102
-
103
 #define START_COL              0
99
 #define START_COL              0
104
 
100
 
105
 U8G_CLASS u8g(U8G_PARAM);
101
 U8G_CLASS u8g(U8G_PARAM);
294
 #if ENABLED(ULTIPANEL)
290
 #if ENABLED(ULTIPANEL)
295
 
291
 
296
   uint8_t row_y1, row_y2;
292
   uint8_t row_y1, row_y2;
297
-  uint8_t constexpr row_height = DOG_CHAR_HEIGHT + 2 * (TALL_FONT_CORRECTION);
298
 
293
 
299
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
294
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
300
 
295
 
301
     void lcd_implementation_hotend_status(const uint8_t row, const uint8_t extruder) {
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
       if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return;
300
       if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return;
306
 
301
 
319
 
314
 
320
   // Set the colors for a menu item based on whether it is selected
315
   // Set the colors for a menu item based on whether it is selected
321
   static bool mark_as_selected(const uint8_t row, const bool isSelected) {
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
     if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return false;
320
     if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return false;
326
 
321
 
330
         u8g.drawHLine(0, row_y2 + 2, LCD_PIXEL_WIDTH);
325
         u8g.drawHLine(0, row_y2 + 2, LCD_PIXEL_WIDTH);
331
       #else
326
       #else
332
         u8g.setColorIndex(1); // black on white
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
         u8g.setColorIndex(0); // white on black
329
         u8g.setColorIndex(0); // white on black
335
       #endif
330
       #endif
336
     }
331
     }

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

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

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

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

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

101
   float raw_Ki, raw_Kd; // place-holders for Ki and Kd edits
101
   float raw_Ki, raw_Kd; // place-holders for Ki and Kd edits
102
 #endif
102
 #endif
103
 
103
 
104
-#ifndef TALL_FONT_CORRECTION
105
-  #define TALL_FONT_CORRECTION 0
106
-#endif
107
-
108
 bool no_reentry = false;
104
 bool no_reentry = false;
109
-constexpr int8_t menu_bottom = LCD_HEIGHT - (TALL_FONT_CORRECTION);
110
 
105
 
111
 // Initialized by settings.load()
106
 // Initialized by settings.load()
112
 int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2];
107
 int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2];
478
   }
473
   }
479
   if (is_menu) {
474
   if (is_menu) {
480
     NOMORE(encoderTopLine, encoderLine);
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
   else
479
   else
485
     encoderTopLine = encoderLine;
480
     encoderTopLine = encoderLine;

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

179
  */
179
  */
180
 #define SCREEN_OR_MENU_LOOP() \
180
 #define SCREEN_OR_MENU_LOOP() \
181
   int8_t _menuLineNr = encoderTopLine, _thisItemNr; \
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
     _thisItemNr = 0
183
     _thisItemNr = 0
184
 
184
 
185
 /**
185
 /**
190
  *               Scroll as-needed to keep the selected line in view.
190
  *               Scroll as-needed to keep the selected line in view.
191
  */
191
  */
192
 #define START_SCREEN() \
192
 #define START_SCREEN() \
193
-  scroll_screen(menu_bottom, false); \
193
+  scroll_screen(LCD_HEIGHT, false); \
194
   bool _skipStatic = false; \
194
   bool _skipStatic = false; \
195
   SCREEN_OR_MENU_LOOP()
195
   SCREEN_OR_MENU_LOOP()
196
 
196
 

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

210
   #endif
210
   #endif
211
 
211
 
212
   #if ENABLED(DOGLCD)
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
   #else
215
   #else
216
     #define SETCURSOR(col, row) lcd_moveto(col, row)
216
     #define SETCURSOR(col, row) lcd_moveto(col, row)
217
     #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_WIDTH - len, row)
217
     #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_WIDTH - len, row)

Loading…
Cancel
Save