|
28 | 28 | * POSSIBILITY OF SUCH DAMAGE.
|
29 | 29 | */
|
30 | 30 |
|
| 31 | +//#define DEBUG |
31 | 32 | #include <stdio.h>
|
32 | 33 | #include <stdlib.h>
|
33 | 34 | #include <LCUI_Build.h>
|
@@ -533,8 +534,8 @@ static size_t WidgetRenderer_RenderContent(LCUI_WidgetRenderer that)
|
533 | 534 | if (that->has_content_graph) {
|
534 | 535 | /* create a render context and it's render rectangle is relative
|
535 | 536 | * to this widget canvas */
|
536 |
| - style.x = -that->style->canvas_box.x; |
537 |
| - style.y = -that->style->canvas_box.y; |
| 537 | + style.x = that->style->x - that->style->canvas_box.x; |
| 538 | + style.y = that->style->y - that->style->canvas_box.y; |
538 | 539 | paint.rect = that->content_rect;
|
539 | 540 | paint.rect.x -= that->style->canvas_box.x;
|
540 | 541 | paint.rect.y -= that->style->canvas_box.y;
|
@@ -596,7 +597,8 @@ static size_t WidgetRenderer_Render(LCUI_WidgetRenderer renderer)
|
596 | 597 | if (!that->has_layer_graph) {
|
597 | 598 | if (that->has_content_graph) {
|
598 | 599 | Graph_Mix(&that->paint->canvas, &that->content_graph,
|
599 |
| - that->content_left, that->content_top, TRUE); |
| 600 | + iround(that->content_left), |
| 601 | + iround(that->content_top), TRUE); |
600 | 602 | }
|
601 | 603 | #ifdef DEBUG_FRAME_RENDER
|
602 | 604 | sprintf(filename, "frame-%lu-%s-canvas-L%d.png", frame++,
|
@@ -649,8 +651,8 @@ size_t Widget_Render(LCUI_Widget w, LCUI_PaintContext paint)
|
649 | 651 | Widget_ComputeActualBorderBox(w, &style);
|
650 | 652 | Widget_ComputeActualCanvasBox(w, &style);
|
651 | 653 | /* reset widget position to relative paint rect */
|
652 |
| - style.x = -style.canvas_box.x; |
653 |
| - style.y = -style.canvas_box.y; |
| 654 | + style.x = (float)-style.canvas_box.x; |
| 655 | + style.y = (float)-style.canvas_box.y; |
654 | 656 | Widget_ComputeActualBorderBox(w, &style);
|
655 | 657 | Widget_ComputeActualCanvasBox(w, &style);
|
656 | 658 | Widget_ComputeActualPaddingBox(w, &style);
|
|
0 commit comments