method and device for processing curvilinear motion of interface elements and computer equipment

文档序号:1694596 发布日期:2019-12-10 浏览:9次 中文

阅读说明:本技术 界面元素曲线运动的处理方法、装置和计算机设备 (method and device for processing curvilinear motion of interface elements and computer equipment ) 是由 黄坤 于 2019-07-23 设计创作,主要内容包括:本申请涉及一种界面元素曲线运动的处理方法、装置、计算机设备和存储介质。基于终端操作体验优化,通过获取基于SVG技术绘制矢量曲线路径图,通过document对象获取矢量曲线路径图的SVG路径对象以及circle对象,调用预设的解析脚本,根据SVG路径对象以及circle对象,对矢量曲线路径图中路径轨迹的坐标点进行提取,获得矢量曲线路径图中路径轨迹的各坐标点;基于document对象对各坐标点进行坐标值分析,确定各坐标点的坐标值;根据各坐标点的坐标值使界面元素在矢量曲线路径图中进行曲线运动。通过document对象及调用预设的解析脚本确定进行界面元素曲线运动时所需的点坐标,提高了坐标点的提取效率。(The application relates to a processing method and device for curvilinear motion of interface elements, computer equipment and a storage medium. Based on terminal operation experience optimization, drawing a vector curve path diagram based on an SVG technology by obtaining an SVG technology, obtaining an SVG path object and a circle object of the vector curve path diagram through a document object, calling a preset analysis script, extracting coordinate points of a path track in the vector curve path diagram according to the SVG path object and the circle object, and obtaining each coordinate point of the path track in the vector curve path diagram; analyzing the coordinate values of the coordinate points based on the document object, and determining the coordinate values of the coordinate points; and according to the coordinate values of the coordinate points, the interface element performs curvilinear motion in the vector curvilinear path diagram. And determining the point coordinates required by the curvilinear motion of the interface elements by the document object and calling a preset analysis script, thereby improving the extraction efficiency of coordinate points.)

1. A method of processing curvilinear movement of an interface element, the method comprising:

Acquiring a vector curve path diagram drawn based on an SVG technology;

Obtaining an SVG path object and a circle object of the vector curve path diagram through a document object;

calling a preset analysis script, and extracting coordinate points of a path track in the vector curve path diagram according to the SVG path object and the circle object to obtain each coordinate point of the path track in the vector curve path diagram;

Analyzing the coordinate values of the coordinate points based on the document object, and determining the coordinate values of the coordinate points;

And performing curvilinear motion on the interface element in the vector curve path diagram according to the coordinate value of each coordinate point.

2. The method according to claim 1, wherein the step of obtaining a vector curve path diagram drawn based on SVG technology comprises:

Acquiring a curve path diagram editing instruction based on an SVG technology;

Setting canvas according to the canvas setting parameters in the curve path diagram editing instruction to obtain the canvas;

aligning the drawing board and the canvas according to a preset mutual alignment mode;

and drawing a curve path on the canvas by using a path label according to a preset d attribute to obtain the vector curve path diagram.

3. The method according to claim 1, wherein the step of calling a preset parsing script to extract coordinate points of a path trajectory in the vector curve path diagram according to the SVG path object and the circle object to obtain each coordinate point of the path trajectory in the vector curve path diagram comprises:

The animateMotion of the SVG path object moves along the path track of the vector curve path diagram according to the circle object to obtain the total movement completion time;

Carrying out time length segmentation on the total movement completion time length according to preset segmentation time length, and determining a coordinate point extraction interval;

and calling the preset analysis script, and extracting each coordinate point of the path track in the vector curve path diagram according to the coordinate point extraction interval.

4. The method of claim 1, wherein said step of imparting a curvilinear motion to said interface element in said vector curvilinear path diagram based on said coordinate values of each of said coordinate points comprises:

in the vector curve path diagram, determining a starting coordinate point of the curvilinear motion according to a coordinate point where the interface element is located;

determining a terminal coordinate point of the curvilinear motion according to the starting coordinate point and a preset moving track;

According to the coordinate value of each coordinate point, carrying out distance analysis on the coordinate points between the starting coordinate point and the ending coordinate point to obtain the distance between the adjacent coordinate points;

and moving the interface element from the starting coordinate point to the end coordinate point according to the distance between the adjacent coordinate points and the coordinate value corresponding to each coordinate point.

5. the method according to claim 4, wherein the step of determining a starting coordinate point of the curvilinear motion according to the coordinate point of the interface element in the vector curvilinear path diagram comprises:

Analyzing the vector curve path diagram according to the characteristics of the interface elements, and determining the positions of the interface elements in the vector curve path diagram;

analyzing the position of the interface element in the vector curve path diagram, and determining a coordinate point of the interface element;

and taking the coordinate point where the interface element is located as a starting coordinate point of curvilinear motion.

6. the method of claim 4, wherein the step of analyzing a distance between coordinate points between the starting coordinate point and the ending coordinate point according to the coordinate value of each coordinate point to obtain a distance between adjacent coordinate points comprises:

Acquiring all coordinate points between the starting coordinate point and the end coordinate point and on the preset moving track through the preset analysis script;

And analyzing adjacent coordinate points in all coordinate points on the preset moving track by taking pixels as units through the preset analysis script to obtain the distance between the adjacent coordinate points.

7. An apparatus for processing curvilinear movement of an interface element, the apparatus comprising:

the path diagram acquisition module is used for acquiring a vector curve path diagram drawn based on the SVG technology;

The object acquisition module is used for acquiring the SVG path object and the circle object of the vector curve path diagram through the document object;

the coordinate point determining module is used for calling a preset analysis script, extracting coordinate points of a path track in the vector curve path diagram according to the SVG path object and the circle object, and obtaining each coordinate point of the path track in the vector curve path diagram;

A coordinate value module, configured to perform coordinate value analysis on each coordinate point based on the document object, and determine a coordinate value of each coordinate point;

and the curve motion module is used for enabling the interface element to perform curve motion in the vector curve path diagram according to the coordinate value of each coordinate point.

8. The apparatus of claim 7, wherein the road map acquisition module comprises:

The command acquisition unit is used for acquiring a curve path diagram editing command based on the SVG technology;

The canvas setting unit is used for setting the canvas according to the canvas setting parameters in the curve path diagram editing instruction to obtain the canvas;

The canvas adjusting unit is used for aligning the drawing board and the canvas according to a preset mutual alignment mode;

And the curve path graph drawing unit is used for drawing a curve path on the canvas by using a path label according to a preset d attribute to obtain the vector curve path graph.

9. a computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 6 when executing the computer program.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.

Technical Field

the present application relates to the field of computer technologies, and in particular, to a method and an apparatus for processing interface element curvilinear motion, a computer device, and a storage medium.

background

with the development of internet technology, the functions of application programs are more and more, in order to enable a user to frequently access the application programs, a check-in function is set in the application programs, the user logs in the application programs by using an account, and the check-in function can receive corresponding rewards and the like.

The functions of checking in and getting daily gift packages are designed for the application, such as: a function of checking in and getting a daily gift bag is designed in the game application A, one month is taken as a check-in period, and the maximum limit of the check-in is 31 days of the check-in. In order to enable visualization of a user and experience of the user, a check-in path of the user is displayed in a check-in interface, check-in interface elements in the check-in process are displayed, and if the check-in icon changes in the interface, the check-in icon moves linearly once a day. Currently, a check-in interface with icons moving linearly is generally adopted, such as: once signed in, an icon for marking the signed-in position moves a position linearly, 31 signed-in points need to be arranged on a preset linear track, a section of interval is needed between the signed-in points and the signed-in points, the interval is wider, all the signed-in interfaces can be seen only by sliding the interfaces for many times, the interval is dense, and the interfaces are too dense. Therefore, 31 check-in points can be arranged on the curve track, so that the icon performs curve motion to the next check-in point, the utilization rate of the check-in interface is increased, but a plurality of coordinate points are required to be arranged for deviation in the curve motion, and the efficiency of the current coordinate point extraction mode is low.

Disclosure of Invention

In view of the above, it is necessary to provide a method, an apparatus, a computer device, and a storage medium for processing curvilinear motion of an interface element, which improve the efficiency of coordinate point extraction.

a method of processing curvilinear movement of an interface element, the method comprising:

acquiring a vector curve path diagram drawn based on an SVG technology;

Obtaining an SVG path object and a circle object of the vector curve path diagram through a document object;

Calling a preset analysis script, and extracting coordinate points of a path track in the vector curve path diagram according to the SVG path object and the circle object to obtain each coordinate point of the path track in the vector curve path diagram;

Analyzing the coordinate values of the coordinate points based on the document object, and determining the coordinate values of the coordinate points;

And performing curvilinear motion on the interface element in the vector curve path diagram according to the coordinate value of each coordinate point.

in one embodiment, the step of obtaining the vector curve path diagram drawn based on the SVG technology includes:

acquiring a curve path diagram editing instruction based on an SVG technology;

Setting canvas according to the canvas setting parameters in the curve path diagram editing instruction to obtain the canvas;

Aligning the drawing board and the canvas according to a preset mutual alignment mode;

And drawing a curve path on the canvas by using a path label according to a preset d attribute to obtain the vector curve path diagram.

In one embodiment, the step of calling the preset parsing script, extracting coordinate points of a path trajectory in the vector curve path diagram according to the SVG path object and the circle object, and obtaining each coordinate point of the path trajectory in the vector curve path diagram includes:

The animateMotion of the SVG path object moves along the path track of the vector curve path diagram according to the circle object to obtain the total movement completion time;

Carrying out time length segmentation on the total movement completion time length according to preset segmentation time length, and determining a coordinate point extraction interval;

And calling the preset analysis script, and extracting each coordinate point of the path track in the vector curve path diagram according to the coordinate point extraction interval.

in one embodiment, the step of performing a curvilinear motion of the interface element in the vector curve path diagram according to the coordinate value of each coordinate point includes:

in the vector curve path diagram, determining a starting coordinate point of the curvilinear motion according to a coordinate point where the interface element is located;

Determining a terminal coordinate point of the curvilinear motion according to the starting coordinate point and a preset moving track;

According to the coordinate value of each coordinate point, carrying out distance analysis on the coordinate points between the starting coordinate point and the ending coordinate point to obtain the distance between the adjacent coordinate points;

And moving the interface element from the starting coordinate point to the end coordinate point according to the distance between the adjacent coordinate points and the coordinate value corresponding to each coordinate point.

In one embodiment, the step of determining a starting coordinate point of the curvilinear motion according to the coordinate point where the interface element is located in the vector curvilinear path diagram includes:

Analyzing the vector curve path diagram according to the characteristics of the interface elements, and determining the positions of the interface elements in the vector curve path diagram;

Analyzing the position of the interface element in the vector curve path diagram, and determining a coordinate point of the interface element;

And taking the coordinate point where the interface element is located as a starting coordinate point of curvilinear motion.

In one embodiment, the step of analyzing a distance between coordinate points between the start coordinate point and the end coordinate point according to the coordinate value of each coordinate point to obtain a distance between adjacent coordinate points includes:

Acquiring all coordinate points between the starting coordinate point and the end coordinate point and on the preset moving track through the preset analysis script;

and analyzing adjacent coordinate points in all coordinate points on the preset moving track by taking pixels as units through the preset analysis script to obtain the distance between the adjacent coordinate points.

a device for processing curvilinear movement of an interface element, the device comprising:

the path diagram acquisition module is used for acquiring a vector curve path diagram drawn based on the SVG technology;

The object acquisition module is used for acquiring the SVG path object and the circle object of the vector curve path diagram through the document object;

The coordinate point determining module is used for calling a preset analysis script, extracting coordinate points of a path track in the vector curve path diagram according to the SVG path object and the circle object, and obtaining each coordinate point of the path track in the vector curve path diagram;

a coordinate value module, configured to perform coordinate value analysis on each coordinate point based on the document object, and determine a coordinate value of each coordinate point;

and the curve motion module is used for enabling the interface element to perform curve motion in the vector curve path diagram according to the coordinate value of each coordinate point.

In one embodiment, the path map obtaining module includes:

The command acquisition unit is used for acquiring a curve path diagram editing command based on the SVG technology;

the canvas setting unit is used for setting the canvas according to the canvas setting parameters in the curve path diagram editing instruction to obtain the canvas;

the canvas adjusting unit is used for aligning the drawing board and the canvas according to a preset mutual alignment mode;

and the curve path graph drawing unit is used for drawing a curve path on the canvas by using a path label according to a preset d attribute to obtain the vector curve path graph.

A computer device comprising a memory storing a computer program and a processor implementing the steps of the method when executing the computer program.

a computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method.

According to the processing method, device, computer equipment and storage medium for the curvilinear motion of the interface element, a vector curve path diagram is drawn based on an SVG technology, an SVG path object and a circle object of the vector curve path diagram are obtained through a document object, a preset analysis script is called, and according to the SVG path object and the circle object, coordinate points of a path track in the vector curve path diagram are extracted to obtain each coordinate point of the path track in the vector curve path diagram; analyzing the coordinate values of the coordinate points based on the document object, and determining the coordinate values of the coordinate points; and according to the coordinate values of the coordinate points, the interface element performs curvilinear motion in the vector curvilinear path diagram. And determining the point coordinates required by the curvilinear motion of the interface elements by the document object and calling a preset analysis script, thereby improving the extraction efficiency of coordinate points.

drawings

FIG. 1 is a diagram illustrating an exemplary scenario for processing a curvilinear movement of an interface element;

FIG. 2 is a schematic flow chart diagram illustrating a method for handling curvilinear movement of interface elements in one embodiment;

FIG. 3 is a block diagram of a processing device for processing the curvilinear movement of the interface element according to an embodiment;

FIG. 4 is a diagram illustrating an internal structure of a computer device according to an embodiment.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

The processing method for the curvilinear motion of the interface element can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The server 104 acquires a vector curve path diagram drawn based on the SVG technology through the terminal 102; obtaining an SVG path object and a circle object of the vector curve path diagram through the document object; calling a preset analysis script, extracting coordinate points of a path track in the vector curve path diagram according to the SVG path object and the circle object, and obtaining each coordinate point of the path track in the vector curve path diagram; analyzing the coordinate values of the coordinate points based on the document object, and determining the coordinate values of the coordinate points; and according to the coordinate values of the coordinate points, the interface element performs curvilinear motion in the vector curvilinear path diagram. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.

in one embodiment, as shown in fig. 2, a method for processing curvilinear movement of an interface element is provided, which is exemplified by applying the method to the server in fig. 1, and includes step S220 and step S320:

And step S220, acquiring a vector curve path diagram drawn based on the SVG technology.

The SVG technology refers to a technology for drawing SVG, and SVG can be drawn by using a tool such as Inkscape (open source vector graphics editing software) or Sketch (software for drawing a Sketch). SVG refers to Scalable vector graphics (Scalable vector graphics), which is a graphics format based on the extensible markup language (a subset of the standard universal markup language) for describing two-dimensional vector graphics. The vector curve path diagram is a scalable vector graph drawn according to a curve path formed by a motion trajectory of an interface element performing a curve motion on an interface, the vector curve path diagram is drawn with the curve path, and the motion trajectory can be designed according to interface requirements, for example: the curve is formed by bending and winding like a spiral road.

step S240, obtaining the SVG path object and the circle object of the vector curve path diagram through the document object.

in the browser, the document object is a relatively important object, and the document object can be used for checking, modifying or adding contents to an HTML document and processing events inside the document. On a Web page, the document object may be referenced by the document attribute of the window object, or directly. The SVG path object refers to an SVG path instance loaded in the memory by the SVG path class. The circle object refers to a circle instance loaded in a memory by a circle class, and is attached to the SVG path object.

step S260, calling a preset analysis script, extracting coordinate points of a path track in the vector curve path diagram according to the SVG path object and the circle object, and obtaining each coordinate point of the path track in the vector curve path diagram;

The preset analysis script can be a JavaScript script, and the coordinate values of the coordinate points are obtained by embedding the preset analysis script in HTML to analyze the vector curve path diagram. The coordinate points of the path trajectory refer to all points on the path trajectory in the vector curve roadmap. The vector curve path diagram is directly embedded in the HTML content, and each coordinate point of the path track in the vector curve path diagram can be extracted by calling a preset analysis script. The path trajectory refers to a motion trajectory of a curved path in a vector curved path diagram. The motion trajectory is realized based on each point, which is each coordinate point.

In step S280, coordinate value analysis is performed on each coordinate point based on the document object, and the coordinate value of each coordinate point is determined.

and the coordinate value of the position of the coordinate point in the vector curve path diagram is the coordinate value of the coordinate point. And determining the coordinate value of each coordinate point through analysis of the document object. In the document object, there is a coordinate value of each pixel point of the vector curve path diagram, and the coordinate value of each coordinate point can be obtained by corresponding each coordinate point in the vector curve path diagram to the pixel point in the vector curve path diagram.

And step S300, enabling the interface element to perform curvilinear motion in the vector curve path diagram according to the coordinate values of the coordinate points.

The interface element refers to a series of elements which meet the interaction requirements of a user and are included in a software or system interface which can meet the interaction requirements, the interface element can be a movable icon, the icon can be one or more, the interface element is embedded in a vector curve path diagram, the interface element can perform curvilinear motion in the vector curve path diagram according to a path track, and when the interface element is to be moved currently, a coordinate point corresponding to the position where the interface element is located is a starting coordinate point of the curvilinear motion.

in the vector curve path diagram, a starting coordinate point and an end point coordinate point are determined according to a coordinate point where the interface element is located, and the interface element is subjected to curve motion according to the starting coordinate point and the end point coordinate point. And performing displacement operation of the coordinate point through a displacement transform () function of the CSS3 technology and a displacement transform () function of the transform of the CSS3 technology, and finishing the curvilinear path motion according to the coordinates of the starting coordinate point of the interface element and smooth transition in a certain time interval according to a preset attribute value. Thereby moving the interface element from the start coordinate point to the end coordinate point. The CSS3 technology is an upgraded version of the CSS (cascading style sheet) technology, is a computer language used to express file styles such as HTML (an application of standard universal markup language) or XML (a subset of standard universal markup language), can statically modify a web page, can dynamically format each element of the web page in cooperation with various scripting languages, can precisely control the layout of element positions in the web page at a pixel level, supports almost all font size styles, and has the ability to edit web page objects and model styles. The basic meaning of the shift transform (x, y) function is to shift the display position of an element by x and y. transform refers to the deformation property of CSS3 technology, including the following: rotation (rotate), skew (skew), scale (scale) and shift (translate), and matrix warping (matrix), among others.

In the processing method for the curvilinear motion of the interface element, a vector curve path diagram is drawn by obtaining an SVG technology, an SVG path object and a circle object of the vector curve path diagram are obtained through a document object, a preset analysis script is called, and according to the SVG path object and the circle object, coordinate points of a path track in the vector curve path diagram are extracted to obtain each coordinate point of the path track in the vector curve path diagram; analyzing the coordinate values of the coordinate points based on the document object, and determining the coordinate values of the coordinate points; and according to the coordinate values of the coordinate points, the interface element performs curvilinear motion in the vector curvilinear path diagram. And determining the point coordinates required by the curvilinear motion of the interface elements by the document object and calling a preset analysis script, thereby improving the extraction efficiency of coordinate points.

in one embodiment, the step of obtaining the vector curve path diagram drawn based on the SVG technology includes: acquiring a curve path diagram editing instruction based on an SVG technology; setting the canvas according to the canvas setting parameters in the curve path diagram editing instruction to obtain the canvas; aligning the drawing board and the canvas according to a preset mutual alignment mode; and drawing a curve path on the canvas by using a path label according to a preset d attribute to obtain a vector curve path diagram.

The curve-path diagram editing instruction can be sent by a user through a terminal, the user can trigger the curve-path diagram editing instruction based on tools such as inskcape, Sketch and the like installed on the terminal, after receiving the curve-path diagram editing instruction, the user enters a drawing interface of the tools such as inskcape, Sketch and the like, canvas setting is carried out in the drawing interface of the tools such as inskcape, Sketch and the like, and corresponding canvas parameters are adjusted, for example: the canvas size is 200px200px and the canvas size is 100px100px, then you draw a line with a length of 10 (not possible with units) inside, the actual length is 20 px. The preset mutual alignment mode can align the drawing board and the canvas according to the habit of a user or the requirement of the vector curve path diagram. The preset mutual alignment mode can be that the canvas is moved to the right frame of the drawing board, so that the right frame of the canvas and the right frame of the drawing board are overlapped, and the canvas can also be moved to the center position of the drawing board. The preset d-attribute may be set according to the shape length of the desired curve, and the like. The path tag is used to define a path, which corresponds to a pen controlled by a command. The vector curve path diagram is constructed by the SVG technology, so that the working efficiency is improved, the quality of the curve diagram is improved, and the processing of the curve path motion is simplified by the vector curve path diagram.

in one embodiment, the step of calling a preset analysis script, extracting coordinate points of a path track in a vector curve path diagram according to an SVG path object and a circle object, and obtaining each coordinate point of the path track in the vector curve path diagram comprises: performing motion according to a path track of a circle object along a vector curve path diagram by using animateMotion of the SVG path object to obtain the total time length of the motion completion; carrying out time length segmentation on the total movement completion time length according to a preset segmentation time length, and determining a coordinate point extraction interval; and calling a preset analysis script to extract each coordinate point of the path track in the vector curve path diagram according to the coordinate point extraction interval.

Here, animateMotion refers to a combination of animate + transform, and is an element of an animation operation on the svg element transform. The total movement completion time duration refers to the time duration of the circle object moving from the starting point of the path track to the end point of the path track at a constant speed on the path track, one end of the path track is the starting point, and the other end of the path track is the end point. The preset segmentation duration can be set according to actual needs, and the preset segmentation duration can be 1ms, 2ms and the like. The coordinate point extraction interval refers to how often coordinate points are extracted. Such as: assuming that the preset segmentation time length is 1ms, assuming that the total time length for completing the movement is 1 minute, coordinate points are required to be extracted within 1ms-1000ms, the coordinate point extraction interval is 1ms, the coordinate points are required to be extracted once when the circle object moves for 1ms, the coordinate points are extracted once when the circle object moves for 1ms through a preset analysis script, and all coordinate points of the path track in the vector curve path diagram are extracted. The coordinate point extraction from the SVG curve is time-saving and labor-saving compared with the traditional manual dotting.

in one embodiment, in the vector curve path diagram, a starting coordinate point of the curve motion is determined according to a coordinate point where the interface element is located; determining a terminal coordinate point of curvilinear motion according to the starting coordinate point and a preset moving track; analyzing the distance between the coordinate points of the starting coordinate point and the terminal coordinate point according to the coordinate values of the coordinate points to obtain the distance between the adjacent coordinate points; and moving the interface element from the starting coordinate point to the end coordinate point according to the distance between the adjacent coordinate points and the coordinate value corresponding to each coordinate point.

The preset moving track is preset according to interface requirements, the moving track can be determined according to the length of a curve path or the moving duration, the preset moving track refers to a preset moving track, and the preset moving track can be a plurality of different moving tracks or the same moving track of each moving. A plurality of coordinate points exist on the track between the starting coordinate point and the terminal coordinate point, all the coordinate points are connected in sequence to form a motion track, and the straight-line distance from each coordinate point to the adjacent coordinate point is the same.

for example: when the interface is used for displaying a check-in process and recording check-in times, a check-in period is assumed to be performed once every 1 day, one month is a check-in period, and one month is 30 days, check-in marks of 30 days need to be displayed in the interface, the check-in marks from the 1 st day to the 30 th day are correspondingly distributed in a curve path of a vector curve path diagram in sequence, a check-in path is formed by corresponding points of the 30 marks in the vector curve path diagram, an interface element moves on the check-in path, the interface element is assumed to be at the position of a check-in point of the 1 st day (the check-in point refers to the corresponding point of the check-in mark in the vector curve path diagram), the moving track of the next interface element is that the check-in point of the 1 st day moves to the check-in point of the 2 nd day, the check-in point of the 1 st day is a starting coordinate point, and the check-in point of the 2 nd. There are 3 points (coordinate points) used for making the interface element move between the check-in point of the 1 st day and the check-in point of the 2 nd day, and assume the check-in point of the 1 st day as point a, the check-in point of the 2 nd day as point e, and point a as the starting point, point e as the terminal point, and there are point b, point c, point d between point a and point e, and the positions on the motion orbit are: a → b → c → d → e, the adjacent coordinate points are: a, b, c, d and e, and analyzing the distance between the coordinate points of the starting coordinate point and the ending coordinate point to obtain the distance between the adjacent coordinate points as follows: the distance between a and b, the distance between b and c, the distance between c and d, and the distance between d and e.

the distance between adjacent coordinate points and the coordinate value corresponding to each coordinate point are assigned to a displacement translate () function of a CSS3 technology through a CSS3 technology, the displacement operation of the coordinate points is carried out through a transform displacement translate () function of a CSS3 technology, the movement (for example, the offset movement is carried out by 8px (which can be manually adjusted) step length) is carried out according to the coordinates of the starting coordinate point of the interface element and the given left (x coordinate) and top (y coordinate) position parameters (the coordinate value of each coordinate point and the distance between the adjacent coordinate points), and the curve path movement is completed through smooth transition in a certain time interval according to the preset attribute value. Thereby moving the interface element from the start coordinate point to the end coordinate point.

in one embodiment, in the vector curve path diagram, the step of determining a starting coordinate point of the curvilinear motion according to the coordinate point where the interface element is located includes: analyzing the vector curve path diagram according to the characteristics of the interface elements, and determining the positions of the interface elements in the vector curve path diagram; analyzing the position of the interface element in the vector curve path diagram, and determining a coordinate point of the interface element; and taking the coordinate point of the interface element as a starting coordinate point of the curvilinear motion.

the interface element may be an icon, and the characteristics of the interface element may be a shape, a color, and the like. And identifying interface elements in the vector curve path diagram, corresponding to coordinates according to positions of the interface elements in the vector curve path diagram, and taking points corresponding to the interface elements as coordinate points where the interface elements are located, namely starting coordinate points of curvilinear motion. And based on the coordinate point where the interface element is located, the starting coordinate point of the curvilinear motion is determined, so that the working efficiency is improved.

in one embodiment, the step of analyzing the distance between the coordinate points of the starting coordinate point and the ending coordinate point according to the coordinate values of the coordinate points to obtain the distance between the adjacent coordinate points includes: acquiring all coordinate points between the starting coordinate point and the end coordinate point on a preset moving track through a preset analysis script; and analyzing adjacent coordinate points in all coordinate points on a preset moving track by taking pixels as units through a preset analysis script to obtain the distance between the adjacent coordinate points.

where a pixel refers to a minimum unit in an image represented by a sequence of numbers. When the curvilinear path motion is processed, time is not needed to be spent on calculating and determining the distance between the adjacent coordinate points, and the working efficiency is improved.

it should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 2 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

In one embodiment, as shown in fig. 3, there is provided a processing apparatus for processing curvilinear motion of an interface element, including: a roadmap acquisition module 310, an object acquisition module 320, a coordinate point determination module 330, a coordinate point value module 340, and a curvilinear motion module 350, wherein:

a path diagram obtaining module 310, configured to obtain a vector curve path diagram drawn based on an SVG technology; an object obtaining module 320, configured to obtain an SVG path object and a circle object of the vector curve path diagram through a document object; a coordinate point determining module 330, configured to invoke a preset parsing script, extract coordinate points of a path trajectory in the vector curve path diagram according to the SVG path object and the circle object, and obtain each coordinate point of the path trajectory in the vector curve path diagram; a coordinate value module 340, configured to perform coordinate value analysis on each coordinate point based on the document object, and determine a coordinate value of each coordinate point; and a curve motion module 350, configured to perform a curve motion on the interface element in the vector curve path according to the coordinate value of each coordinate point.

in one embodiment, the path map obtaining module 310 includes: the command acquisition unit is used for acquiring a curve path diagram editing command based on the SVG technology; the canvas setting unit is used for setting the canvas according to the canvas setting parameters in the curve path diagram editing instruction to obtain the canvas; the canvas adjusting unit is used for aligning the drawing board and the canvas according to a preset mutual alignment mode; and the curve path graph drawing unit is used for drawing a curve path on the canvas by using a path label according to a preset d attribute to obtain the vector curve path graph.

In one embodiment, the coordinate point determination module 330 is configured to: performing motion according to a path track of a circle object along a vector curve path diagram by using animateMotion of the SVG path object to obtain the total time length of the motion completion; carrying out time length segmentation on the total movement completion time length according to a preset segmentation time length, and determining a coordinate point extraction interval; and calling a preset analysis script to extract each coordinate point of the path track in the vector curve path diagram according to the coordinate point extraction interval.

in one embodiment, the curvilinear motion module 350 includes: the starting coordinate point determining unit is used for determining a starting coordinate point of curvilinear motion according to a coordinate point where the interface element is located in the vector curve path diagram; the terminal point coordinate point determining unit is used for determining a terminal point coordinate point of the curvilinear motion according to the starting coordinate point and a preset moving track; the distance analysis unit is used for carrying out distance analysis on coordinate points between the starting coordinate point and the end point coordinate point according to the coordinate values of the coordinate points to obtain the distance between the adjacent coordinate points; and the curve motion unit is used for moving the interface element from the starting coordinate point to the end coordinate point according to the distance between the adjacent coordinate points and the coordinate value corresponding to each coordinate point.

In one embodiment, the starting coordinate point determination unit is configured to: analyzing the vector curve path diagram according to the characteristics of the interface elements, and determining the positions of the interface elements in the vector curve path diagram; analyzing the position of the interface element in the vector curve path diagram, and determining a coordinate point of the interface element; and taking the coordinate point of the interface element as a starting coordinate point of the curvilinear motion.

In one embodiment, the distance analysis unit is configured to: acquiring all coordinate points between the starting coordinate point and the end coordinate point on a preset moving track through a preset analysis script; and analyzing adjacent coordinate points in all coordinate points on a preset moving track by taking pixels as units through a preset analysis script to obtain the distance between the adjacent coordinate points.

for the specific limitation of the processing device for the interface element curvilinear motion, reference may be made to the above limitation on the processing method for the interface element curvilinear motion, and details are not described here. The modules in the processing device for the curvilinear motion of the interface element can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.

in one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method for processing curvilinear motion of an interface element.

Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.

in one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program:

acquiring a vector curve path diagram drawn based on an SVG technology; obtaining an SVG path object and a circle object of the vector curve path diagram through the document object; calling a preset analysis script, extracting coordinate points of a path track in the vector curve path diagram according to the SVG path object and the circle object, and obtaining each coordinate point of the path track in the vector curve path diagram; analyzing the coordinate values of the coordinate points based on the document object, and determining the coordinate values of the coordinate points; and according to the coordinate values of the coordinate points, the interface element performs curvilinear motion in the vector curvilinear path diagram.

In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring a curve path diagram editing instruction based on an SVG technology; setting the canvas according to the canvas setting parameters in the curve path diagram editing instruction to obtain the canvas; aligning the drawing board and the canvas according to a preset mutual alignment mode; and drawing a curve path on the canvas by using a path label according to a preset d attribute to obtain a vector curve path diagram.

In one embodiment, the processor, when executing the computer program, further performs the steps of: performing motion according to a path track of a circle object along a vector curve path diagram by using animateMotion of the SVG path object to obtain the total time length of the motion completion; carrying out time length segmentation on the total movement completion time length according to a preset segmentation time length, and determining a coordinate point extraction interval; and calling a preset analysis script, and extracting each coordinate point of the path track in the vector curve path diagram according to the coordinate point extraction interval.

In one embodiment, the processor, when executing the computer program, further performs the steps of: in the vector curve path diagram, determining a starting coordinate point of the curvilinear motion according to a coordinate point where the interface element is located; determining a terminal coordinate point of curvilinear motion according to the starting coordinate point and a preset moving track; analyzing the distance between the coordinate points of the starting coordinate point and the terminal coordinate point according to the coordinate values of the coordinate points to obtain the distance between the adjacent coordinate points; and moving the interface element from the starting coordinate point to the end coordinate point according to the distance between the adjacent coordinate points and the coordinate value corresponding to each coordinate point.

In one embodiment, the processor, when executing the computer program, further performs the steps of: analyzing the vector curve path diagram according to the characteristics of the interface elements, and determining the positions of the interface elements in the vector curve path diagram; analyzing the position of the interface element in the vector curve path diagram, and determining a coordinate point of the interface element; and taking the coordinate point of the interface element as a starting coordinate point of the curvilinear motion.

in one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring all coordinate points between the starting coordinate point and the end coordinate point on a preset moving track through a preset analysis script; and analyzing adjacent coordinate points in all coordinate points on a preset moving track by taking pixels as units through a preset analysis script to obtain the distance between the adjacent coordinate points.

In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:

acquiring a vector curve path diagram drawn based on an SVG technology; obtaining an SVG path object and a circle object of the vector curve path diagram through the document object; calling a preset analysis script, extracting coordinate points of a path track in the vector curve path diagram according to the SVG path object and the circle object, and obtaining each coordinate point of the path track in the vector curve path diagram; analyzing the coordinate values of the coordinate points based on the document object, and determining the coordinate values of the coordinate points; and according to the coordinate values of the coordinate points, the interface element performs curvilinear motion in the vector curvilinear path diagram.

in one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a curve path diagram editing instruction based on an SVG technology; setting the canvas according to the canvas setting parameters in the curve path diagram editing instruction to obtain the canvas; aligning the drawing board and the canvas according to a preset mutual alignment mode; and drawing a curve path on the canvas by using a path label according to a preset d attribute to obtain a vector curve path diagram.

In one embodiment, the computer program when executed by the processor further performs the steps of: performing motion according to a path track of a circle object along a vector curve path diagram by using animateMotion of the SVG path object to obtain the total time length of the motion completion; carrying out time length segmentation on the total movement completion time length according to a preset segmentation time length, and determining a coordinate point extraction interval; and calling a preset analysis script, and extracting each coordinate point of the path track in the vector curve path diagram according to the coordinate point extraction interval.

in one embodiment, the processor, when executing the computer program, further performs the steps of: in the vector curve path diagram, determining a starting coordinate point of the curvilinear motion according to a coordinate point where the interface element is located; determining a terminal coordinate point of curvilinear motion according to the starting coordinate point and a preset moving track; analyzing the distance between the coordinate points of the starting coordinate point and the terminal coordinate point according to the coordinate values of the coordinate points to obtain the distance between the adjacent coordinate points; and moving the interface element from the starting coordinate point to the end coordinate point according to the distance between the adjacent coordinate points and the coordinate value corresponding to each coordinate point.

In one embodiment, the computer program when executed by the processor further performs the steps of: analyzing the vector curve path diagram according to the characteristics of the interface elements, and determining the positions of the interface elements in the vector curve path diagram; analyzing the position of the interface element in the vector curve path diagram, and determining a coordinate point of the interface element; and taking the coordinate point of the interface element as a starting coordinate point of the curvilinear motion.

in one embodiment, the computer program when executed by the processor further performs the steps of: acquiring all coordinate points between the starting coordinate point and the end coordinate point on a preset moving track through a preset analysis script; and analyzing adjacent coordinate points in all coordinate points on a preset moving track by taking pixels as units through a preset analysis script to obtain the distance between the adjacent coordinate points.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.

the above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:图片选择方法、系统、介质和电子设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!