@@ -25,7 +25,7 @@ static Color gdiplus_color(web_color color)
25
25
return Color (color.alpha , color.red , color.green , color.blue );
26
26
}
27
27
28
- void gdiplus_container::draw_ellipse (HDC hdc, int x, int y, int width, int height, web_color color, int line_width)
28
+ void gdiplus_container::draw_ellipse (HDC hdc, litehtml:: pixel_t x, litehtml:: pixel_t y, litehtml:: pixel_t width, litehtml:: pixel_t height, web_color color, int line_width)
29
29
{
30
30
Graphics graphics (hdc);
31
31
@@ -36,7 +36,7 @@ void gdiplus_container::draw_ellipse(HDC hdc, int x, int y, int width, int heigh
36
36
graphics.DrawEllipse (&pen, x, y, width, height);
37
37
}
38
38
39
- void gdiplus_container::fill_ellipse (HDC hdc, int x, int y, int width, int height, web_color color)
39
+ void gdiplus_container::fill_ellipse (HDC hdc, litehtml:: pixel_t x, litehtml:: pixel_t y, litehtml:: pixel_t width, litehtml:: pixel_t height, web_color color)
40
40
{
41
41
Graphics graphics (hdc);
42
42
@@ -47,7 +47,7 @@ void gdiplus_container::fill_ellipse(HDC hdc, int x, int y, int width, int heigh
47
47
graphics.FillEllipse (&brush, x, y, width, height);
48
48
}
49
49
50
- void gdiplus_container::fill_rect (HDC hdc, int x, int y, int width, int height, web_color color)
50
+ void gdiplus_container::fill_rect (HDC hdc, litehtml:: pixel_t x, litehtml:: pixel_t y, litehtml:: pixel_t width, litehtml:: pixel_t height, web_color color)
51
51
{
52
52
Graphics graphics (hdc);
53
53
@@ -88,7 +88,7 @@ void gdiplus_container::draw_img_bg(HDC hdc, uint_ptr img, const litehtml::backg
88
88
scaled_img = new Bitmap (bg.origin_box .width , bg.origin_box .height );
89
89
Graphics gr (scaled_img);
90
90
gr.SetPixelOffsetMode (PixelOffsetModeHighQuality);
91
- gr.DrawImage (bgbmp, 0 , 0 , bg.origin_box .width , bg.origin_box .height );
91
+ gr.DrawImage (bgbmp, 0.0 , 0. 0 , bg.origin_box .width , bg.origin_box .height );
92
92
bgbmp = scaled_img;
93
93
}
94
94
@@ -147,11 +147,11 @@ void gdiplus_container::draw_img_bg(HDC hdc, uint_ptr img, const litehtml::backg
147
147
const float dash = 3 ;
148
148
const float space = 2 ;
149
149
150
- static void draw_horz_border (Graphics& graphics, const border& border, int y, int left, int right)
150
+ static void draw_horz_border (Graphics& graphics, const border& border, litehtml:: pixel_t y, litehtml:: pixel_t left, litehtml:: pixel_t right)
151
151
{
152
152
if (border.style != border_style_double || border.width < 3 )
153
153
{
154
- if (border.width == 1 ) right-- ; // 1px-wide lines are longer by one pixel in GDI+ (the endpoint is also drawn)
154
+ if (border.width == 1 ) right -= 1 ; // 1px-wide lines are longer by one pixel in GDI+ (the endpoint is also drawn)
155
155
Pen pen (gdiplus_color (border.color ), (float )border.width );
156
156
if (border.style == border_style_dotted)
157
157
{
@@ -164,24 +164,24 @@ static void draw_horz_border(Graphics& graphics, const border& border, int y, in
164
164
pen.SetDashPattern (dashValues, 2 );
165
165
}
166
166
graphics.DrawLine (&pen,
167
- Point (left, y + border.width / 2 ),
168
- Point (right, y + border.width / 2 ));
167
+ PointF (left, y + border.width / 2 ),
168
+ PointF (right, y + border.width / 2 ));
169
169
}
170
170
else
171
171
{
172
- int single_line_width = ( int ) round ( border.width / 3 .) ;
173
- if (single_line_width == 1 ) right-- ;
172
+ litehtml:: pixel_t single_line_width = border.width / 3.0 ;
173
+ if (single_line_width == 1 ) right -= 1 ;
174
174
Pen pen (gdiplus_color (border.color ), (float )single_line_width);
175
175
graphics.DrawLine (&pen,
176
- Point (left, y + single_line_width / 2 ),
177
- Point (right, y + single_line_width / 2 ));
176
+ PointF (left, y + single_line_width / 2 ),
177
+ PointF (right, y + single_line_width / 2 ));
178
178
graphics.DrawLine (&pen,
179
- Point (left, y + border.width - 1 - single_line_width / 2 ),
180
- Point (right, y + border.width - 1 - single_line_width / 2 ));
179
+ PointF (left, y + border.width - 1 - single_line_width / 2 ),
180
+ PointF (right, y + border.width - 1 - single_line_width / 2 ));
181
181
}
182
182
}
183
183
184
- static void draw_vert_border (Graphics& graphics, const border& border, int x, int top, int bottom)
184
+ static void draw_vert_border (Graphics& graphics, const border& border, litehtml:: pixel_t x, litehtml:: pixel_t top, litehtml:: pixel_t bottom)
185
185
{
186
186
if (border.style != border_style_double || border.width < 3 )
187
187
{
@@ -198,20 +198,20 @@ static void draw_vert_border(Graphics& graphics, const border& border, int x, in
198
198
pen.SetDashPattern (dashValues, 2 );
199
199
}
200
200
graphics.DrawLine (&pen,
201
- Point (x + border.width / 2 , top),
202
- Point (x + border.width / 2 , bottom));
201
+ PointF (x + border.width / 2 , top),
202
+ PointF (x + border.width / 2 , bottom));
203
203
}
204
204
else
205
205
{
206
- int single_line_width = ( int ) round ( border.width / 3 .) ;
206
+ litehtml:: pixel_t single_line_width = border.width / 3.0 ;
207
207
if (single_line_width == 1 ) bottom--;
208
208
Pen pen (gdiplus_color (border.color ), (float )single_line_width);
209
209
graphics.DrawLine (&pen,
210
- Point (x + single_line_width / 2 , top),
211
- Point (x + single_line_width / 2 , bottom));
210
+ PointF (x + single_line_width / 2 , top),
211
+ PointF (x + single_line_width / 2 , bottom));
212
212
graphics.DrawLine (&pen,
213
- Point (x + border.width - 1 - single_line_width / 2 , top),
214
- Point (x + border.width - 1 - single_line_width / 2 , bottom));
213
+ PointF (x + border.width - 1 - single_line_width / 2 , top),
214
+ PointF (x + border.width - 1 - single_line_width / 2 , bottom));
215
215
}
216
216
}
217
217
0 commit comments