Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
fix Group's mask pass and modify rnoh package name
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis-C7 committed Apr 10, 2024
1 parent 740060e commit 731e166
Show file tree
Hide file tree
Showing 26 changed files with 31 additions and 30 deletions.
Binary file modified harmony/svg.har
Binary file not shown.
4 changes: 2 additions & 2 deletions harmony/svg/oh-package.json5
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"name": "@react-native-oh-tpl/react-native-svg",
"description": "Native part of react-native-svg",
"main": "index.ets",
"version": "13.14.0-0.2.4",
"version": "13.14.0-0.2.1",
"dependencies": {
"rnoh": "file:../rnoh"
"@rnoh/react-native-openharmony": "file:../rnoh"
}
}
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/SVGComponentFactory.ets
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

import { Descriptor, ComponentBuilderContext, RNOHContext, Tag, RNComponentFactory } from 'rnoh'
import { Descriptor, ComponentBuilderContext, RNOHContext, Tag, RNComponentFactory } from '@rnoh/react-native-openharmony'
import { SVGGroup, SVG_GROUP_TYPE_NAME } from './components/SVGGroup'
import { SVGPath, SVG_PATH_TYPE_NAME } from './components/SVGPath'
import { SVGRect, SVG_RECT_TYPE_NAME } from './components/SVGRect'
Expand Down
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/SVGView.ets
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
ColorSegments,
RNViewManager,
ViewDescriptorWrapperBase,
} from 'rnoh'
} from '@rnoh/react-native-openharmony'
import Logger from './common/log/Logger'
import { getGroupBox, getScaleValue } from './common/SVGCommon'
import { setViewDescriptor } from './common/SVGTempCache'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import { convertColorValueToColorSegments } from 'rnoh';
import { convertColorValueToColorSegments } from '@rnoh/react-native-openharmony';

import {
getColor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
import { SVGViewCommon, SVGViewRawCommon } from '../common/SVGType';
import { SVGLinearGradientValue } from '../common/SVGLinearGradient';
import { getMaskDescriptor } from '../common/SVGTempCache';
import { convertColorValueToColorSegments } from 'rnoh';
import { convertColorValueToColorSegments } from '@rnoh/react-native-openharmony';

export class SVGPathModifier implements AttributeModifier<PathAttribute> {
private constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { SVGClipPathObj, SVGViewCommon, SVGViewRawCommon } from '../common/SVGTy
import { getClipPathDescriptor, getMaskDescriptor } from '../common/SVGTempCache';
import { SVGRectDescriptor, SVGRectDescriptorWrapper } from '../components/SVGRect';
import { SVGLinearGradientValue } from '../common/SVGLinearGradient';
import { convertColorValueToColorSegments } from 'rnoh';
import { convertColorValueToColorSegments } from '@rnoh/react-native-openharmony';

export class SVGRectModifier implements AttributeModifier<RectAttribute> {
private constructor() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { convertColorValueToColorSegments } from 'rnoh';
import { convertColorValueToColorSegments } from '@rnoh/react-native-openharmony';
import { getColor, getRawColor } from "../common/SVGCommon";
import { SVGUseDescriptor } from "../components/SVGUse";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
resolveBorderMetrics,
RNOHContext,
TransformMatrix
} from 'rnoh';
} from '@rnoh/react-native-openharmony';
import matrix4 from '@ohos.matrix4';
import { SVGViewDescriptor, SVGViewDescriptorWrapper } from '../SVGView';

Expand Down
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/common/SVGClipPathFactory.ets
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

import { Tag, RNOHContext, Descriptor } from 'rnoh'
import { Tag, RNOHContext, Descriptor } from '@rnoh/react-native-openharmony'
import { SVG_PATH_TYPE_NAME, SVGPathDescriptor } from "../components/SVGPath"
import { SVG_RECT_TYPE_NAME, SVGRectDescriptor } from "../components/SVGRect"
import { SVG_IMAGE_TYPE_NAME, SVGImageDescriptor } from "../components/SVGImage"
Expand Down
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/common/SVGCommon.ets
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

import { ColorSegments, convertColorSegmentsToString, convertColorValueToHex, TransformMatrix } from 'rnoh'
import { ColorSegments, convertColorSegmentsToString, convertColorValueToHex, TransformMatrix } from '@rnoh/react-native-openharmony'
import { getLinearGradientValue } from './SVGTempCache'
import { SVGColorValue, SVGRawColorValue, SVGGroupBox, SVGOffset } from './SVGType'
import { SVGViewDescriptor } from '../SVGView'
Expand Down
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/common/SVGDefsFactory.ets
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

import { Tag, RNOHContext, Descriptor } from 'rnoh'
import { Tag, RNOHContext, Descriptor } from '@rnoh/react-native-openharmony'
import { SVG_PATH_TYPE_NAME, SVGPathDescriptor } from "../components/SVGPath"
import { SVG_RECT_TYPE_NAME, SVGRectDescriptor } from "../components/SVGRect"
import { SVG_IMAGE_TYPE_NAME, SVGImageDescriptor } from "../components/SVGImage"
Expand Down
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/common/SVGLinearGradient.ets
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

import { convertColorValueToRGBA, Descriptor, RNOHContext, Tag } from 'rnoh'
import { convertColorValueToRGBA, Descriptor, RNOHContext, Tag } from '@rnoh/react-native-openharmony'
import Logger from './log/Logger'
import { parseCoordinateValue } from './SVGCommon'
import { setLinearGradientValue } from './SVGTempCache'
Expand Down
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/common/SVGMask.ets
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Descriptor, RNOHContext, Tag } from 'rnoh'
import { Descriptor, RNOHContext, Tag } from '@rnoh/react-native-openharmony'
import { SVGCircleDescriptor, SVG_CIRCLE_TYPE_NAME } from '../components/SVGCircle'
import { SVGPathDescriptor, SVG_PATH_TYPE_NAME } from '../components/SVGPath'
import { SVGRectDescriptor, SVG_RECT_TYPE_NAME } from '../components/SVGRect'
Expand Down
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/common/SVGMergeProperties.ets
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import { convertColorValueToColorSegments } from 'rnoh';
import { convertColorValueToColorSegments } from '@rnoh/react-native-openharmony';

import { ColorSegments, SVGColorValue, SVGRawColorValue } from './SVGType'

Expand Down
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/common/SVGTempCache.ets
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import HashMap from '@ohos.util.HashMap'
import { SVGViewDescriptor } from '../SVGView'
import { SVGGroupDescriptor } from '../components/SVGGroup'
import { SVGMaskType } from './SVGMask'
import { Descriptor } from "rnoh";
import { Descriptor } from "@rnoh/react-native-openharmony";
import { SVGLinearGradientValue } from './SVGLinearGradient'

const viewCache: HashMap<number, SVGViewDescriptor> = new HashMap()
Expand Down
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/common/SVGType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import { ViewBaseProps, ViewRawProps } from 'rnoh/ts';
import { ViewBaseProps, ViewRawProps } from '@rnoh/react-native-openharmony/ts';

/** 0-1 */
export type NormalizedScalar = number
Expand Down
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/components/SVGCircle.ets
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

import { Descriptor, RNOHContext, ViewDescriptorWrapperBase } from 'rnoh'
import { Descriptor, RNOHContext, ViewDescriptorWrapperBase } from '@rnoh/react-native-openharmony'
import { SVGCircleModifier } from '../attributeModifiers/SVGCircleModifier'
import Logger from '../common/log/Logger';
import { getColor, getRawColor, getFillOpacity, getRawFillOpacity, getGradient, getOffset, getStrokeWidth, getTransform } from '../common/SVGCommon';
Expand Down
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/components/SVGEllipse.ets
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

import { Descriptor, RNOHContext, ViewDescriptorWrapperBase } from 'rnoh'
import { Descriptor, RNOHContext, ViewDescriptorWrapperBase } from '@rnoh/react-native-openharmony'
import { SVGEllipseModifier } from '../attributeModifiers/SVGEllipseModifier'
import Logger from '../common/log/Logger';
import { SVGEllipseProps, SVGViewCommon, SVGViewRawCommon, SVGState, SVGBaseRawProps } from '../common/SVGType'
Expand Down
5 changes: 4 additions & 1 deletion harmony/svg/src/main/ets/components/SVGGroup.ets
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

import { Descriptor, RNOHContext, ComponentBuilderContext, Tag, ViewDescriptorWrapperBase,
convertColorValueToColorSegments } from 'rnoh'
convertColorValueToColorSegments } from '@rnoh/react-native-openharmony'
import { SVGBaseProps, SVGBaseRawProps, SVGState, SVGGroupProps, SVGViewCommon, SVGViewRawCommon } from '../common/SVGType'
import { setDefsDescriptor, setGroupDescriptor } from '../common/SVGTempCache'
import { SVG_DEFS_TYPE_NAME, SVGDefsFactory } from '../common/SVGDefsFactory'
Expand Down Expand Up @@ -144,6 +144,9 @@ export struct SVGGroup {
descriptor.layoutMetrics.frame.origin = this.descriptor.layoutMetrics.frame.origin
descriptor.rawProps.fill = parseRawFill(descriptor.rawProps.fill, this.descriptor.rawProps.fill, this.svgViewCommon?.svgColor)
descriptor.props.stroke = parseStroke(descriptor.props.stroke, this.descriptor.props.stroke, convertColorValueToColorSegments(this.svgViewCommon?.svgColor))
if (this.descriptor.props.mask) {
descriptor.props.mask = this.descriptor.props.mask
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions harmony/svg/src/main/ets/components/SVGImage.ets
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
* SOFTWARE.
*/

import { Descriptor, RNOHContext, ViewDescriptorWrapperBase } from 'rnoh'
import { ImageLoaderTurboModule } from 'rnoh/src/main/ets/RNOHCorePackage/turboModules';
import { Descriptor, RNOHContext, ViewDescriptorWrapperBase } from '@rnoh/react-native-openharmony'
import { ImageLoaderTurboModule } from '@rnoh/react-native-openharmony/src/main/ets/RNOHCorePackage/turboModules';
import { SVGImageModifier } from '../attributeModifiers/SVGImageModifier';
import Logger from '../common/log/Logger';
import { SVGImageProps, SVGViewCommon, SVGViewRawCommon, SVGBaseRawProps, SVGState } from '../common/SVGType'
import { RemoteImageLoaderError } from 'rnoh/src/main/ets/RemoteImageLoader/RemoteImageLoaderError';
import { RemoteImageLoaderError } from '@rnoh/react-native-openharmony/src/main/ets/RemoteImageLoader/RemoteImageLoaderError';

export const SVG_IMAGE_TYPE_NAME: string = "RNSVGImage"

Expand Down
4 changes: 1 addition & 3 deletions harmony/svg/src/main/ets/components/SVGPath.ets
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
* SOFTWARE.
*/

import { Descriptor, RNOHContext, ViewDescriptorWrapperBase } from 'rnoh'
import { Descriptor, RNOHContext, ViewDescriptorWrapperBase } from '@rnoh/react-native-openharmony'
import Logger from '../common/log/Logger'
import { SVGPathProps, SVGViewCommon, SVGViewRawCommon, SVGBaseRawProps, SVGState } from '../common/SVGType'
import { SVGLinearGradientValue } from '../common/SVGLinearGradient'
import emitter from '@ohos.events.emitter';
import { SVGPathModifier } from '../attributeModifiers/SVGPathModifier'

export const SVG_PATH_TYPE_NAME: string = "RNSVGPath"
Expand Down
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/components/SVGRect.ets
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

import { Descriptor, RNOHContext, ViewDescriptorWrapperBase } from 'rnoh'
import { Descriptor, RNOHContext, ViewDescriptorWrapperBase } from '@rnoh/react-native-openharmony'
import { SVGRectModifier } from '../attributeModifiers/SVGRectModifier'
import Logger from '../common/log/Logger'
import { SVGRectProps, SVGViewCommon, SVGViewRawCommon, SVGBaseRawProps, SVGState } from '../common/SVGType'
Expand Down
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/components/SVGTSpan.ets
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

import { Descriptor, RNOHContext,ViewDescriptorWrapperBase } from 'rnoh'
import { Descriptor, RNOHContext,ViewDescriptorWrapperBase } from '@rnoh/react-native-openharmony'
import { SVGTSpanModifier } from '../attributeModifiers/SVGTSpanModifier'
import Logger from '../common/log/Logger'
import { getOffset } from '../common/SVGCommon'
Expand Down
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/components/SVGText.ets
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

import { Descriptor, RNOHContext, Tag, ViewDescriptorWrapperBase } from 'rnoh'
import { Descriptor, RNOHContext, Tag, ViewDescriptorWrapperBase } from '@rnoh/react-native-openharmony'
import { SVGTextModifier } from '../attributeModifiers/SVGTextModifier'
import Logger from '../common/log/Logger'
import { getOffset } from '../common/SVGCommon'
Expand Down
2 changes: 1 addition & 1 deletion harmony/svg/src/main/ets/components/SVGUse.ets
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Descriptor, RNOHContext, Tag } from "rnoh";
import { Descriptor, RNOHContext, Tag } from "@rnoh/react-native-openharmony";
import { SVGUseModifier } from "../attributeModifiers/SVGUseModifier";
import { getDefsDescriptor } from "../common/SVGTempCache";
import { SVGUseProps, SVGState, SVGBaseRawProps } from "../common/SVGType";
Expand Down

0 comments on commit 731e166

Please sign in to comment.