From e9d1cd5d10bd68eb86aa9b145b7231eb096badf1 Mon Sep 17 00:00:00 2001 From: Captain Mirage Date: Wed, 27 Nov 2024 11:49:59 +0330 Subject: [PATCH] Error fix sub_window.rs error fix for lines 301 to 304 --- druid/examples/sub_window.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/druid/examples/sub_window.rs b/druid/examples/sub_window.rs index a643adac7..255793969 100644 --- a/druid/examples/sub_window.rs +++ b/druid/examples/sub_window.rs @@ -2,6 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 //! Example of sub windows. + +// dependencies +// druid = "0.8.3" +// druid-shell = "0.8.3" +// piet = "0.7.0" +// instant = "0.1.13" +// tracing = "0.1.40" // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] @@ -19,7 +26,10 @@ use druid::{ use druid_shell::piet::Text; use druid_shell::{Screen, WindowLevel}; use instant::{Duration, Instant}; -use piet_common::{TextLayout, TextLayoutBuilder}; +use druid::piet::{TextLayout, TextLayoutBuilder}; +// not sure why but using the piet package instead of +// piet-common fixes an error in lines 301 to 304 +// OLD - use piet_common::{TextLayout, TextLayoutBuilder}; const VERTICAL_WIDGET_SPACING: f64 = 20.0; const TEXT_BOX_WIDTH: f64 = 200.0;