File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -126,3 +126,14 @@ TcThemeBuilder & TcThemeBuilder::enablingTcUnicode() {
126126 renderer.enableTcUnicode ();
127127 return *this ;
128128}
129+
130+ TcThemeBuilder& TcThemeBuilder::dimensionsFromRenderer () {
131+ auto dims = renderer.getDeviceDrawable ()->getDisplayDimensions ();
132+ renderer.setDisplayDimensions (dims.x , dims.y );
133+ return *this ;
134+ }
135+
136+ TcThemeBuilder& TcThemeBuilder::manualDimensions (int x, int y) {
137+ renderer.setDisplayDimensions (x, y);
138+ return *this ;
139+ }
Original file line number Diff line number Diff line change @@ -503,6 +503,21 @@ namespace tcgfx {
503503 return *this ;
504504 }
505505
506+ /* *
507+ * Apply the dimensions from the device drawable to the renderer, this takes the device specific size and applies
508+ * it to the renderer.
509+ * @return reference to itself for chaining
510+ */
511+ TcThemeBuilder& dimensionsFromRenderer ();
512+
513+ /* *
514+ * Manually set the dimensions of the display, for cases where `dimensionsFromRenderer` does not work.
515+ * @param x the width
516+ * @param y the height
517+ * @return reference to itself for chaining
518+ */
519+ TcThemeBuilder& manualDimensions (int x, int y);
520+
506521 /* *
507522 * Use this to enable card layout for the root menu, and configure the icons that will be used for left and
508523 * right buttons.
You can’t perform that action at this time.
0 commit comments