@@ -25,7 +25,7 @@ litehtml::uint_ptr BrocContainer::create_font(const litehtml::font_description&
2525 auto faceName = descr.family ;
2626 auto size = descr.size ;
2727
28- auto italic = descr.decoration_style ;
28+ auto italic = descr.style ;
2929 auto weight = descr.weight ;
3030
3131 // auto fontKey = std::string(faceName) + "_" + std::to_string(size);
@@ -102,9 +102,9 @@ void BrocContainer::delete_font(litehtml::uint_ptr hFont) {
102102 this ->fontCache .erase (hFont);
103103}
104104
105- int BrocContainer::text_width (const char * text, litehtml::uint_ptr hFont) {
105+ litehtml:: pixel_t BrocContainer::text_width (const char * text, litehtml::uint_ptr hFont) {
106106 auto font = this ->fontCache [hFont];
107- return CST_GetFontWidth (font, text);
107+ return (litehtml:: pixel_t ) CST_GetFontWidth (font, text);
108108}
109109
110110void BrocContainer::draw_text (litehtml::uint_ptr hdc, const char * text, litehtml::uint_ptr hFont, litehtml::web_color color, const litehtml::position& pos) {
@@ -121,12 +121,12 @@ void BrocContainer::draw_text(litehtml::uint_ptr hdc, const char* text, litehtml
121121 }
122122}
123123
124- int BrocContainer::pt_to_px (int pt) const {
125- return pt;
124+ litehtml:: pixel_t BrocContainer::pt_to_px (float pt) const {
125+ return (litehtml:: pixel_t ) pt;
126126}
127127
128- int BrocContainer::get_default_font_size () const {
129- return 20 ;
128+ litehtml:: pixel_t BrocContainer::get_default_font_size () const {
129+ return 20 . 0f ;
130130}
131131
132132const char * BrocContainer::get_default_font_name () const {
@@ -269,7 +269,7 @@ void BrocContainer::draw_image(
269269 const std::string& url,
270270 const std::string& base_url
271271) {
272- printf (" Requested to draw image\n " );
272+ // printf("Requested to draw image\n");
273273 auto renderer = RootDisplay::mainDisplay->renderer ;
274274
275275 CST_Rect dimens = {
@@ -280,14 +280,14 @@ void BrocContainer::draw_image(
280280 };
281281
282282 // printf("Background drawn at: %d, %d, %d, %d\n", dimens.x, dimens.y, dimens.w, dimens.h);
283- printf (" Name of image: %s\n " , url.c_str ());
283+ // printf("Name of image: %s\n", url.c_str());
284284
285285 // position the image according to the background position
286286 if (url.length () > 0 ) {
287287 auto resolvedUrl = resolve_url (url.c_str (), base_url.c_str ());
288288 auto img = this ->imageCache [resolvedUrl];
289289 if (img != nullptr ) {
290- printf (" Positioning image: %s, postion %d , %d \n " , url.c_str (), bg.clip_box .x , bg.clip_box .y );
290+ // printf("Positioning image: %s, postion %f , %f \n", url.c_str(), bg.clip_box.x, bg.clip_box.y);
291291 img->setPosition (webView->x + bg.clip_box .x , -1 *webView->y + bg.clip_box .y );
292292 img->setSize (dimens.w , dimens.h );
293293
@@ -582,6 +582,7 @@ std::shared_ptr<litehtml::element> BrocContainer::create_element(const char *tag
582582
583583void BrocContainer::get_media_features (litehtml::media_features& media ) const {
584584 // printf("Getting media features\n");
585+ media.type = litehtml::media_type_screen;
585586 media.width = RootDisplay::screenWidth;
586587 media.height = RootDisplay::screenHeight;
587588 media.device_width = RootDisplay::screenWidth;
0 commit comments