/foundation/arkui/ace_engine/frameworks/core/components_ng/svg/ |
H A D | svg_utils.cpp | 23 if (LessOrEqual(viewBox.Width(), 0.0) || LessOrEqual(viewBox.Height(), 0.0)) { in CalculateSvgConentSize() 24 svgContentSize.SetWidth(LessNotEqual(svgSize.Width(), 0.0) ? svgContainerSize.Width() : svgSize.Width()); in CalculateSvgConentSize() 28 if (LessNotEqual(svgSize.Width(), 0.0) && LessNotEqual(svgSize.Height(), 0.0)) { in CalculateSvgConentSize() 29 svgContentSize.SetWidth(svgContainerSize.Width()); in CalculateSvgConentSize() 33 if (LessNotEqual(svgSize.Width(), 0.0)) { in CalculateSvgConentSize() 34 svgContentSize.SetWidth(viewBox.Width() / viewBox.Height() * svgSize.Height()); in CalculateSvgConentSize() 39 svgContentSize.SetWidth(svgSize.Width()); in CalculateSvgConentSize() 40 svgContentSize.SetHeight(viewBox.Height() / viewBox.Width() * svgSiz in CalculateSvgConentSize() [all...] |
H A D | svg_fit_convertor.cpp | 45 if (NearZero(svgSize.Width()) || NearZero(svgSize.Height())) { in ApplyFit() 56 canvas.Scale(layoutSize.Width() / svgSize.Width(), layoutSize.Height() / svgSize.Height()); 62 std::min(layoutSize.Width() / svgSize.Width(), layoutSize.Height() / svgSize.Height()), Alignment::CENTER); 68 std::max(layoutSize.Width() / svgSize.Width(), layoutSize.Height() / svgSize.Height()), Alignment::CENTER); 73 AdjustContentFit(canvas, layoutSize, svgSize, layoutSize.Width() / svgSize.Width(), Alignment::CENTER); 88 auto scale = std::min(layoutSize.Width() / svgSiz [all...] |
/foundation/arkui/ace_engine/frameworks/core/components_ng/svg/parse/ |
H A D | svg_svg.cpp | 59 if (LessOrEqual(viewBox.Width(), 0.0) || LessOrEqual(viewBox.Height(), 0.0)) { in AdjustContentAreaByViewBox() 60 RSRect clipRect(0.0f, 0.0f, LessNotEqual(svgSize.Width(), 0.0) ? viewPort.Width() : svgSize.Width(), in AdjustContentAreaByViewBox() 65 if (LessNotEqual(svgSize.Width(), 0.0) && LessNotEqual(svgSize.Height(), 0.0)) { in AdjustContentAreaByViewBox() 66 RSRect clipRect(0.0f, 0.0f, viewPort.Width(), viewPort.Height()); in AdjustContentAreaByViewBox() 68 auto scale = std::min(viewPort.Width() / viewBox.Width(), viewPort.Height() / viewBox.Height()); in AdjustContentAreaByViewBox() 69 auto translateX = (viewPort.Width() - viewBox.Width() * scal in AdjustContentAreaByViewBox() [all...] |
/foundation/arkui/ace_engine/frameworks/core/components/stack/ |
H A D | render_stack.cpp | 97 offset.GetX() + positionedItem->GetLayoutSize().Width() > GetLayoutSize().Width() || in PerformLayout() 109 maxSize.SetWidth(viewPort_.Width()); in DetermineStackSize() 119 double width = GetLayoutParam().GetMinSize().Width(); in DetermineStackSize() 128 double constrainedWidth = std::clamp(item->GetLayoutSize().Width(), GetLayoutParam().GetMinSize().Width(), in DetermineStackSize() 129 GetLayoutParam().GetMaxSize().Width()); in DetermineStackSize() 135 maxX = std::max(maxX, item->GetLayoutSize().Width() + NormalizePercentToPx(item->GetLeft(), false)); in DetermineStackSize() 141 double constrainedWidth = std::clamp(item->GetLayoutSize().Width(), in DetermineStackSize() 142 GetLayoutParam().GetMinSize().Width(), GetLayoutPara in DetermineStackSize() [all...] |
/foundation/arkui/ace_engine/frameworks/core/components/track/ |
H A D | rosen_render_capsule_track.cpp | 39 double progressWidth = canvasSize.Width(); in DrawShape() 50 rRect.setRectXY(SkRect::MakeIWH(progressSize.Width(), progressSize.Height()), rrectRadius, rrectRadius); in DrawShape() 59 RSRect(0, 0, static_cast<RSScalar>(progressSize.Width()), in DrawShape() 84 double capsuleWidth = canvasSize.Width(); in DrawCapsuleProgressAnimation() 89 double progressWidth = progressSize.Width()*GetTotalRatio(); in DrawCapsuleProgressAnimation() 98 } else if (GreatNotEqual(progressWidth, progressSize.Width() - radius)) { in DrawCapsuleProgressAnimation() 100 { radius + offsetX, offsetY, progressSize.Width() - radius + offsetX, progressSize.Height() + offsetY }); in DrawCapsuleProgressAnimation() 101 path.addArc({ (progressSize.Width() - radius) * 2.0 - progressWidth + offsetX, offsetY, progressWidth + offsetX, in DrawCapsuleProgressAnimation() 121 } else if (GreatNotEqual(progressWidth, progressSize.Width() - radius)) { in DrawCapsuleProgressAnimation() 122 path.AddRect(radius + offsetX, offsetY, progressSize.Width() in DrawCapsuleProgressAnimation() [all...] |
/foundation/arkui/ace_engine/frameworks/core/components/video/ |
H A D | render_texture.cpp | 94 textureSizeChangeEvent_(textureId_, drawSize_.Width(), drawSize_.Height()); in PerformLayout() 105 double width = GetLayoutParam().GetMinSize().Width(); in Measure() 109 width = std::max(width, item->GetLayoutSize().Width()); in Measure() 149 alignmentX_ = imagePosition_.GetSizeValueX() * (layoutSize.Width() - drawSize_.Width()) / PERCENT_TRANSLATE; in ApplyObjectPosition() 162 double layoutRatio = NearZero(layoutSize.Height()) ? 0.0 : layoutSize.Width() / layoutSize.Height(); in CalculateFitContain() 163 double sourceRatio = NearZero(sourceSize_.Height()) ? layoutRatio : sourceSize_.Width() / sourceSize_.Height(); in CalculateFitContain() 169 drawSize_ = Size(layoutSize.Width(), layoutSize.Width() / sourceRatio); in CalculateFitContain() 176 double layoutRatio = NearZero(layoutSize.Height()) ? 0.0 : layoutSize.Width() / layoutSiz in CalculateFitCover() [all...] |
/foundation/arkui/ace_engine/frameworks/core/components_ng/render/ |
H A D | debug_boundary_painter.cpp | 39 frameMarginSize_.Width() - HALF_STROKE_WIDTH_OFFSET - marginOffset.GetX(), in PaintDebugBoundary() 55 auto marginRight = frameMarginSize_.Width() - contentSize_.Width() - marginLeft; in PaintDebugMargin() 60 RSRect(startPointX, startPointY, frameMarginSize_.Width() + startPointX, startPointY + marginTop); in PaintDebugMargin() 63 frameMarginSize_.Width() + startPointX, startPointY + frameMarginSize_.Height()); in PaintDebugMargin() 68 layoutRect = RSRect(startPointX + frameMarginSize_.Width() - marginRight, startPointY + marginTop, in PaintDebugMargin() 69 startPointX + frameMarginSize_.Width(), startPointY + marginTop + verticalRectHeight); in PaintDebugMargin() 86 canvas.DrawLine(RSPoint(startPointX + frameMarginSize_.Width() - BOUNDARY_CORNER_LENGTH, startPointY), in PaintDebugCorner() 87 RSPoint(startPointX + frameMarginSize_.Width() - HALF_STROKE_WIDTH_OFFSET, startPointY)); in PaintDebugCorner() 88 canvas.DrawLine(RSPoint(startPointX + frameMarginSize_.Width() in PaintDebugCorner() [all...] |
H A D | image_painter.cpp | 35 dstRect.SetSize(rawPicSize * (dstSize.Width() / rawPicSize.Width())); in ApplyContain() 47 srcRect.SetSize(dstSize * (rawPicSize.Width() / dstSize.Width())); in ApplyCover() 60 dstRect.SetSize(rawPicSize * (dstSize.Width() / rawPicSize.Width())); in ApplyFitWidth() 63 srcRect.SetSize(dstSize * (rawPicSize.Width() / dstSize.Width())); in ApplyFitWidth() 81 SizeF srcSize(std::min(dstSize.Width(), rawPicSize.Width()), st in ApplyNone() [all...] |
/foundation/arkui/ace_engine/frameworks/core/components/common/painter/ |
H A D | debug_boundary_painter.cpp | 42 layoutSize.Width() - HALF_STROKE_WIDTH_OFFSET, layoutSize.Height() - HALF_STROKE_WIDTH_OFFSET); in PaintDebugBoundary() 54 layoutSize.Width() - HALF_STROKE_WIDTH_OFFSET + offset.GetX(), 76 layoutSize.Width(), margin.TopPx()); in PaintDebugMargin() 80 layoutSize.Width(), margin.BottomPx()); in PaintDebugMargin() 87 layoutRect = SkRect::MakeXYWH(startPointX + layoutSize.Width() - margin.RightPx(), startPointY + margin.TopPx(), in PaintDebugMargin() 102 layoutSize.Width() + startPointX, margin.TopPx() + startPointY); in PaintDebugMargin() 107 layoutSize.Width() + startPointX, startPointY + layoutSize.Height()); in PaintDebugMargin() 114 layoutRect = RSRect(startPointX + layoutSize.Width() - margin.RightPx(), in PaintDebugMargin() 115 startPointY + margin.TopPx(), startPointX + layoutSize.Width(), in PaintDebugMargin() 135 canvas->drawLine(startPointX + layoutSize.Width() in PaintDebugCorner() [all...] |
H A D | rosen_scroll_fade_painter.cpp | 35 double baseGlowScale = size.Width() > size.Height() ? size.Height() / size.Width() : 1.0; in Paint() 36 double radius = size.Width() * 3.0 / 2.0; in Paint() 37 double height = std::min(size.Height(), size.Width() * WIDTH_TO_HEIGHT_FACTOR); in Paint() 39 const auto& clipRect = Rect(Offset::Zero(), Size(size.Width(), height)); in Paint() 40 Offset center = Offset(size.Width() / 2.0, height - radius); in Paint() 60 double baseGlowScale = size.Width() > size.Height() ? size.Height() / size.Width() : 1.0; 61 double radius = size.Width() * 3.0 / 2.0; 62 double height = std::min(size.Height(), size.Width() * WIDTH_TO_HEIGHT_FACTO [all...] |
/foundation/arkui/ace_engine/test/unittest/core/property/ |
H A D | layout_constraint_test_ng.cpp | 59 EXPECT_EQ(layoutConstraint.parentIdealSize.Width().value(), 768.0); in HWTEST_F() 63 * @tc.expected: the selfIdealSize.Width() = selfIdealSize.Height() * 1. in HWTEST_F() 72 EXPECT_EQ(layoutConstraint.selfIdealSize.Width(), layoutConstraint.selfIdealSize.Height()); in HWTEST_F() 76 and selfIdealSize.Width(). in HWTEST_F() 77 * @tc.expected: the selfIdealSize.Width() = selfIdealSize.Height() * 2. in HWTEST_F() 85 EXPECT_EQ(layoutConstraint.selfIdealSize.Width().value(), layoutConstraint.selfIdealSize.Height().value() * 2); in HWTEST_F() 90 * @tc.expected: the selfIdealSize.Width() = selfIdealSize.Height() * 4. in HWTEST_F() 98 EXPECT_EQ(layoutConstraint.selfIdealSize.Width().value(), layoutConstraint.selfIdealSize.Height().value() * 4); in HWTEST_F() 107 EXPECT_EQ(layoutConstraint.parentIdealSize.Width().value(), 768.0); in HWTEST_F() 117 EXPECT_EQ(layoutConstraint.parentIdealSize.Width() in HWTEST_F() [all...] |
/foundation/arkui/ace_engine/frameworks/core/components/common/layout/ |
H A D | layout_param.h | 77 return (minSize_.Width() >= maxSize_.Width()) && (minSize_.Height() >= maxSize_.Height()); in IsTight() 82 return (maxSize_.Width() >= minSize_.Width()) && (maxSize_.Width() > 0.0); in IsWidthValid() 93 if (size.Width() < 0) { in Constrain() 94 constrainSize.SetWidth(size.Width()); in Constrain() 96 constrainSize.SetWidth(std::clamp(size.Width(), minSize_.Width(), maxSize_.Width())); in Constrain() [all...] |
/foundation/arkui/ace_engine/frameworks/core/components_ng/pattern/scroll/effect/ |
H A D | scroll_fade_painter.cpp | 28 if (NearZero(opacity_) || NearZero(size.Width()) || NearZero(size.Height())) { in Paint() 32 float baseGlowScale = size.Width() > size.Height() ? size.Height() / size.Width() : 1.0; in Paint() 33 float radius = size.Width() * 3.0 / 2.0; in Paint() 34 float height = std::min(size.Height(), size.Width() * WIDTH_TO_HEIGHT_FACTOR); in Paint() 36 const auto& clipRect = Rect(Offset::Zero(), Size(size.Width(), height)); in Paint() 37 Offset center = Offset(size.Width() / 2.0, height - radius); in Paint() 79 Paint(canvas, SizeF(size.Height(), size.Width()), offset); in PaintSide() 85 canvas.Translate(size.Width(), 0.0); in PaintSide() 87 Paint(canvas, SizeF(size.Height(), size.Width()), offse in PaintSide() [all...] |
/foundation/arkui/ace_engine/frameworks/base/geometry/ng/ |
H A D | size_t.h | 54 T Width() const in Width() function in OHOS::Ace::NG::SizeT 96 width_ = SizeT.Width(); in SetSizeT() 271 width_ = width_ > minSize.Width() ? width_ : minSize.Width(); 281 width_ = width_ < maxSize.Width() ? width_ : maxSize.Width(); in UpdateMax() 316 return SizeT(width_ + size.Width(), height_ + size.Height()); 321 width_ += size.Width(); 328 return SizeT(width_ - size.Width(), height_ - size.Height()); 333 width_ -= size.Width(); [all...] |
/foundation/arkui/ace_engine/frameworks/core/components/svg/ |
H A D | rosen_render_svg.cpp | 40 if (GreatNotEqual(viewBox_.Width(), 0.0) && GreatNotEqual(viewBox_.Height(), 0.0)) { in UpdateTransformByGlobalOffset() 42 std::min(GetLayoutSize().Width() / viewBox_.Width(), GetLayoutSize().Height() / viewBox_.Height()); in UpdateTransformByGlobalOffset() 43 double tx = GetLayoutSize().Width() * 0.5 - (viewBox_.Width() * 0.5 + viewBox_.Left()) * scale; in UpdateTransformByGlobalOffset() 48 double pivotX = ConvertDimensionToPx(transformOrigin_.first, LengthType::HORIZONTAL, true) / viewBox_.Width(); in UpdateTransformByGlobalOffset()
|
/foundation/arkui/ace_engine/frameworks/core/components_ng/pattern/menu/menu_item/ |
H A D | menu_item_layout_algorithm.cpp | 43 maxRowWidth_ = layoutConstraint->maxSize.Width() - padding.Width(); in Measure() 47 calcConstraint->selfIdealSize.value().Width().has_value()) { in Measure() 55 ConvertToPx(calcConstraint->selfIdealSize.value().Width()->GetDimension(), scaleProperty, in Measure() 56 layoutConstraint->percentReference.Width())); in Measure() 58 if (layoutConstraint->selfIdealSize.Width().has_value()) { in Measure() 60 std::max(layoutConstraint->minSize.Width(), in Measure() 61 std::min(layoutConstraint->maxSize.Width(), layoutConstraint->selfIdealSize.Width().value())) - in Measure() 62 padding.Width(); in Measure() [all...] |
/foundation/arkui/ace_engine/frameworks/core/components/image/ |
H A D | render_image.cpp | 430 double pictureSizeRatio = pictureSize.Width() / pictureSize.Height(); in CalculateBackupImageSize() 437 backupImageSize.SetHeight(imageComponentSize_.Width() / pictureSizeRatio); in CalculateBackupImageSize() 460 double widthEnlargedBy = resizeTarget_.Width() / previousResizeTarget_.Width(); in NeedResize() 478 double widthScale = dstRect_.Width() / srcRect_.Width() * scale_; in CalculateResizeTarget() 485 resizeTarget_ = Size(rawImageSize_.Width() * resizeScale_.Width(), rawImageSize_.Height() * resizeScale_.Height()); in CalculateResizeTarget() 529 dstRect.SetSize(rawPicSize * (layoutSize.Width() / rawPicSize.Width())); in ApplyContain() [all...] |
/foundation/arkui/ace_engine/frameworks/core/components_ng/pattern/checkboxgroup/ |
H A D | checkboxgroup_layout_algorithm.cpp | 26 // Case 1: Width and height are set in the front end. in MeasureContent() 27 if (contentConstraint.selfIdealSize.Width().has_value() && contentConstraint.selfIdealSize.Height().has_value() && in MeasureContent() 30 auto width = contentConstraint.selfIdealSize.Width().value(); in MeasureContent() 35 // 2.1 Width is set to a value in MeasureContent() 36 if (contentConstraint.selfIdealSize.Width().has_value() && in MeasureContent() 37 NonNegative(contentConstraint.selfIdealSize.Width().value())) { in MeasureContent() 38 auto width = contentConstraint.selfIdealSize.Width().value(); in MeasureContent() 47 // Case 3: Width and height are not set in the front end, so return from the theme in MeasureContent() 52 if (!NearEqual(size.Width(), size.Height())) { in MeasureContent() 53 auto length = std::min(size.Width(), siz in MeasureContent() [all...] |
/foundation/arkui/ace_engine/frameworks/core/components_ng/pattern/calendar/ |
H A D | calendar_layout_algorithm.cpp | 47 if (GreaterOrEqualToInfinity(maxSize.Width()) || GreaterOrEqualToInfinity(maxSize.Height())) { in MeasureContent() 50 std::max(maxSize.Width(), calendarMinSize.Width()), std::max(minSize.Height(), calendarMinSize.Height())); in MeasureContent() 53 std::max(maxSize.Width(), calendarMinSize.Width()), std::max(maxSize.Height(), calendarMinSize.Height())); in MeasureContent() 55 if (GreaterOrEqualToInfinity(maxSize.Width()) || GreaterOrEqualToInfinity(maxSize.Height())) { in MeasureContent() 65 maxWidth_ = constrainSize.Width(); in MeasureContent()
|
/foundation/arkui/ace_engine/frameworks/core/components_ng/pattern/menu/ |
H A D | multi_menu_layout_algorithm.cpp | 32 childConstraint.maxSize.SetWidth(layoutConstraint->maxSize.Width()); in Measure() 44 if (layoutConstraint->selfIdealSize.Width().has_value()) { in Measure() 47 if (LessNotEqual(layoutConstraint->selfIdealSize.Width().value(), MIN_MENU_WIDTH.ConvertToPx())) { in Measure() 54 UpdateMenuDefaultConstraintByDevice(pattern, childConstraint, padding.Width(), layoutConstraint, true); in Measure() 58 std::max(layoutConstraint->minSize.Width(), in Measure() 59 std::min(layoutConstraint->maxSize.Width(), layoutConstraint->selfIdealSize.Width().value())) - in Measure() 60 padding.Width(); in Measure() 68 auto minWidth = static_cast<float>(columnInfo->GetWidth()) - padding.Width(); in Measure() 71 UpdateMenuDefaultConstraintByDevice(pattern, childConstraint, padding.Width(), layoutConstrain in Measure() [all...] |
/foundation/arkui/ace_engine/frameworks/core/components/checkable/ |
H A D | rosen_render_checkbox.cpp | 156 Offset(drawSize_.Width() * CHECK_MARK_PART_START_X_POSITION, drawSize_.Width() * CHECK_MARK_PART_Y_POSITION); in DrawPartSelect() 158 Offset(drawSize_.Width() * CHECK_MARK_PART_END_Y_POSITION, drawSize_.Width() * CHECK_MARK_PART_Y_POSITION); in DrawPartSelect() 180 paintSize.SetWidth(paintSize.Width() - borderWidth); in DrawUnselected() 204 Offset(drawSize_.Width() * CHECK_MARK_START_X_POSITION, drawSize_.Width() * CHECK_MARK_START_Y_POSITION); in DrawCheck() 206 Offset(drawSize_.Width() * CHECK_MARK_MIDDLE_X_POSITION, drawSize_.Width() * CHECK_MARK_MIDDLE_Y_POSITION); in DrawCheck() 208 Offset(drawSize_.Width() * CHECK_MARK_END_X_POSITIO in DrawCheck() [all...] |
/foundation/distributedhardware/distributed_camera/services/cameraservice/base/test/unittest/common/base/ |
H A D | dcamera_capture_info_cmd_test.cpp | 38 {"Width": 1920, "Height": 1080, "Format": 1, "DataSpace": 1, 49 {"Width": 1920, "Height": 1080, "Format": 1, "DataSpace": 1, 59 {"Width": 1920, "Height": 1080, "Format": 1, "DataSpace": 1, 70 {"Width": 1920, "Height": 1080, "Format": 1, "DataSpace": 1, 80 {"Width": 1920, "Height": 1080, "Format": 1, "DataSpace": 1, 91 {"Width": 1920, "Height": 1080, "Format": 1, "DataSpace": 1, 108 {"Width": 1920, "Height": 1080, "Format": 1, "DataSpace": 1, 119 {"Width": 1920, "Height": 1080, "Format": 1, "DataSpace": 1, 141 {"Width": "1920", "Height": 1080, "Format": 1, "DataSpace": 1, 152 {"Width" [all...] |
/foundation/arkui/ace_engine/frameworks/core/components_ng/property/ |
H A D | layout_constraint.h | 39 if (first.Width().has_value() ^ second.Width().has_value()) { in CompareWithInfinityCheck() 42 auto widthBothInf = GreaterOrEqualToInfinity(first.Width().value_or(0.0f)) && in CompareWithInfinityCheck() 43 GreaterOrEqualToInfinity(second.Width().value_or(0.0f)); in CompareWithInfinityCheck() 44 if (!widthBothInf && !NearEqual(first.Width().value_or(0), second.Width().value_or(0))) { in CompareWithInfinityCheck() 60 auto widthBothInf = GreaterOrEqualToInfinity(first.Width()) && GreaterOrEqualToInfinity(second.Width()); in CompareWithInfinityCheck() 65 return NearEqual(first.Width(), second.Width()) in CompareWithInfinityCheck() [all...] |
/foundation/arkui/ace_engine/frameworks/core/components_ng/render/adapter/ |
H A D | background_modifier.h | 38 auto curWidth = curSize.Width(); 52 SkRect srcSKRect = SkRect::MakeXYWH(offset1.GetX(), offset1.GetY(), srcSize.Width(), srcSize.Height()); 54 offset2.GetY() * curHeight / initialNodeHeight_, srcSize.Width() * curWidth / initialNodeWidth_, 56 if (srcSize.Width() > desSize.Width()) { 57 srcSKRect.fRight = offset1.GetX() + desSize.Width(); 72 auto curWidth = curSize.Width(); 85 RSRect srcRSRect = RSRect(offset1.GetX(), offset1.GetY(), srcSize.Width() + offset1.GetX(), 89 srcSize.Width() * curWidth / initialNodeWidth_ + offset2.GetX() * curWidth / initialNodeWidth_, 92 if (srcSize.Width() > desSiz [all...] |
/foundation/arkui/ace_engine/frameworks/core/components_ng/pattern/linear_split/ |
H A D | linear_split_layout_algorithm.cpp | 62 if (!layoutConstraint->selfIdealSize.Width()) { in Measure() 63 float width = std::max(minSize.Width(), childTotalSize.Width()); in Measure() 64 if (maxSize.Width() > 0) { in Measure() 65 width = std::min(maxSize.Width(), width); in Measure() 68 width = childrenDragPos_.back() - childrenDragPos_.front() + padding.Width(); in Measure() 84 if (!layoutConstraint->selfIdealSize.Width()) { in Measure() 85 realSize.SetWidth(std::min(maxSize.Width(), childMaxSize.Width())); in Measure() 116 if (!layoutConstraint->selfIdealSize.Width()) { in MeasureBeforeAPI10() [all...] |