11/*
22 * DISTRHO Plugin Framework (DPF)
3- * Copyright (C) 2012-2025 Filipe Coelho <[email protected] > 43 * Copyright (C) 2019-2021 Jean Pierre Cimalando <[email protected] > 4+ * Copyright (C) 2012-2026 Filipe Coelho <[email protected] > 55 *
66 * Permission to use, copy, modify, and/or distribute this software for any purpose with
77 * or without fee is hereby granted, provided that the above copyright notice and this
@@ -736,7 +736,11 @@ template class ImageBaseSwitch<CairoImage>;
736736
737737// -----------------------------------------------------------------------
738738
739- void SubWidget::PrivateData::display (const uint width, const uint height, const double autoScaleFactor)
739+ void SubWidget::PrivateData::display (const uint width, const uint height
740+ #if DGL_ALLOW_DEPRECATED_METHODS
741+ , const double autoScaleFactor
742+ #endif
743+ )
740744{
741745 cairo_t * const handle = static_cast <const CairoGraphicsContext&>(self->getGraphicsContext ()).handle ;
742746
@@ -754,10 +758,13 @@ void SubWidget::PrivateData::display(const uint width, const uint height, const
754758 {
755759 // full viewport size
756760 cairo_translate (handle, 0 , 0 );
761+ #if DGL_ALLOW_DEPRECATED_METHODS
757762 cairo_scale (handle, autoScaleFactor, autoScaleFactor);
763+ #endif
758764 }
759765 else
760766 {
767+ #if DGL_ALLOW_DEPRECATED_METHODS
761768 // set viewport pos
762769 cairo_translate (handle, absolutePos.getX () * autoScaleFactor, absolutePos.getY () * autoScaleFactor);
763770
@@ -767,12 +774,21 @@ void SubWidget::PrivateData::display(const uint width, const uint height, const
767774 0 ,
768775 std::round (self->getWidth () * autoScaleFactor),
769776 std::round (self->getHeight () * autoScaleFactor));
777+ #else
778+ // set viewport pos
779+ cairo_translate (handle, absolutePos.getX (), absolutePos.getY ());
780+
781+ // then cut the outer bounds
782+ cairo_rectangle (handle, 0 , 0 , self->getWidth (), self->getHeight ());
783+ #endif
770784
771785 cairo_clip (handle);
772786 needsResetClip = true ;
773787
788+ #if DGL_ALLOW_DEPRECATED_METHODS
774789 // set viewport scaling
775790 cairo_scale (handle, autoScaleFactor, autoScaleFactor);
791+ #endif
776792 }
777793
778794 // display widget
@@ -783,7 +799,11 @@ void SubWidget::PrivateData::display(const uint width, const uint height, const
783799
784800 cairo_set_matrix (handle, &matrix);
785801
802+ #if DGL_ALLOW_DEPRECATED_METHODS
786803 selfw->pData ->displaySubWidgets (width, height, autoScaleFactor);
804+ #else
805+ selfw->pData ->displaySubWidgets (width, height);
806+ #endif
787807}
788808
789809// -----------------------------------------------------------------------
@@ -799,26 +819,34 @@ void TopLevelWidget::PrivateData::display()
799819 const uint width = size.getWidth ();
800820 const uint height = size.getHeight ();
801821
822+ #if DGL_ALLOW_DEPRECATED_METHODS
802823 const double autoScaleFactor = window.pData ->autoScaleFactor ;
824+ #endif
803825
804826 cairo_matrix_t matrix;
805827 cairo_get_matrix (handle, &matrix);
806828
807829 // full viewport size
808830 cairo_translate (handle, 0 , 0 );
809831
832+ #if DGL_ALLOW_DEPRECATED_METHODS
810833 if (window.pData ->autoScaling )
811834 cairo_scale (handle, autoScaleFactor, autoScaleFactor);
812835 else
813836 cairo_scale (handle, 1.0 , 1.0 );
837+ #endif
814838
815839 // main widget drawing
816840 self->onDisplay ();
817841
818842 cairo_set_matrix (handle, &matrix);
819843
820844 // now draw subwidgets if there are any
821- selfw->pData ->displaySubWidgets (width, height, autoScaleFactor);
845+ selfw->pData ->displaySubWidgets (width, height
846+ #if DGL_ALLOW_DEPRECATED_METHODS
847+ , autoScaleFactor
848+ #endif
849+ );
822850}
823851
824852// -----------------------------------------------------------------------
0 commit comments