CN114579238A - Primitive alignment method, device and equipment - Google Patents

Primitive alignment method, device and equipment Download PDF

Info

Publication number
CN114579238A
CN114579238A CN202210189863.2A CN202210189863A CN114579238A CN 114579238 A CN114579238 A CN 114579238A CN 202210189863 A CN202210189863 A CN 202210189863A CN 114579238 A CN114579238 A CN 114579238A
Authority
CN
China
Prior art keywords
primitive
adjusted
alignment
point
alignment mode
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210189863.2A
Other languages
Chinese (zh)
Inventor
刘紫千
余启明
常力元
曹然
佟欣哲
李金伟
陈林
刘长波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Safety Technology Co Ltd
Original Assignee
Tianyi Safety Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianyi Safety Technology Co Ltd filed Critical Tianyi Safety Technology Co Ltd
Priority to CN202210189863.2A priority Critical patent/CN114579238A/en
Publication of CN114579238A publication Critical patent/CN114579238A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the application provides a method, a device and equipment for aligning a graphic primitive, wherein the method comprises the following steps: monitoring the displacement of the primitive to be adjusted, and respectively calculating the distance between the primitive to be adjusted and each reference primitive positioned on the same page; when at least one reference primitive with the distance to the primitive to be adjusted smaller than a first threshold value is monitored, respectively predicting the alignment mode of the at least one reference primitive and generating an adsorption line corresponding to the alignment mode; when a target reference primitive with the distance to the primitive to be adjusted smaller than a second threshold value is monitored, positioning an alignment position in the primitive to be adjusted according to an alignment mode corresponding to an adsorption line of the target reference primitive; and adjusting the position of the primitive to be adjusted until the alignment position in the primitive to be adjusted is overlapped with the adsorption line of the target reference primitive. By using the method, the automatic alignment of the graphic elements is realized, and the problems of inaccurate alignment, time consumption and labor consumption caused by manual alignment are solved.

Description

Primitive alignment method, device and equipment
Technical Field
The present application relates to the technical field of UI design, and in particular, to a method, an apparatus, and a device for primitive alignment.
Background
With the popularization of mobile terminal devices, a large number of small programs or applications are emerging in the application market of the mobile terminal devices, wherein applications capable of realizing a graphic editing function are more and more popular with users, generally, the applications capable of realizing the graphic editing function can provide customized templates, primitive lists and other materials for users, meanwhile, the functions of zooming, rotating, editing characters and the like of primitives are supported, and the users can make personal electronic business cards and posters for picture refinement and the like after simple learning.
When a user needs to perform small-amplitude position alignment adjustment on a certain primitive, one generally adopted method is to assist the user in adjusting the primitive position by amplifying the area where the primitive is located, and under the condition, the primitive display is sometimes limited by the size of a display screen of a mobile terminal or pixel setting, so that the situation of fuzzy primitive display occurs, and the user is inconvenient to identify and operate the primitive; in another mode, the primitive is dragged by means of a reference line or a grid line, so that the position of the primitive is adjusted, under the condition, a user sometimes difficultly grasps the degree of the primitive adjustment, the position of the primitive is greatly deviated due to the fact that the speed of dragging the primitive is too high, or the speed of dragging the primitive is too low, the position of the primitive is not obviously changed, the user needs to repeatedly try and continuously adjust the position of the primitive, the whole process is time-consuming and labor-consuming, and the user experience is poor.
Disclosure of Invention
The invention provides a primitive alignment method, which is used for solving the problem that the position of a primitive cannot be accurately adjusted to an aligned position when fine adjustment alignment is carried out on the position of the primitive in the prior art.
In a first aspect, the present application provides a primitive alignment method, including:
monitoring the displacement of the primitive to be adjusted, and respectively calculating the distance between the primitive to be adjusted and each reference primitive positioned on the same page;
when monitoring at least one reference primitive with the distance to the primitive to be adjusted smaller than a first threshold value, respectively predicting an alignment mode of the primitive to be adjusted and the at least one reference primitive, and generating an adsorption line corresponding to the alignment mode;
when a target reference primitive with the distance to the primitive to be adjusted smaller than a second threshold value is monitored, positioning an alignment position in the primitive to be adjusted according to an alignment mode corresponding to an adsorption line of the target reference primitive;
and adjusting the position of the primitive to be adjusted until the alignment position in the primitive to be adjusted is overlapped with the adsorption line of the target reference primitive.
An optional implementation manner is that, calculating distances between the primitive to be adjusted and reference primitives located on the same page respectively, includes:
establishing a coordinate system by taking any point in the page as a coordinate origin;
and respectively selecting a reference point on the primitive to be adjusted and the reference primitive aiming at each reference primitive in the reference primitives, and determining the distance between the primitive to be adjusted and the reference primitive according to the coordinate value of the reference point of the primitive to be adjusted and the coordinate value of the reference point of the reference primitive.
An optional implementation manner is that, respectively selecting a reference point on the primitive to be adjusted and the reference primitive, including:
respectively determining the edge outlines of the primitive to be adjusted and the reference primitive by utilizing an edge detection algorithm;
selecting a first point in the edge contour point set of the primitive to be adjusted, and selecting a second point in the edge contour point set of the reference primitive, so that the distance between the first point and the second point is the closest;
and determining the first point as a reference point of the primitive to be adjusted, and determining the second point as a reference point of the reference primitive.
An optional embodiment is that, predicting an alignment manner with the at least one reference primitive, and generating a suction line corresponding to the alignment manner, respectively, includes:
generating a minimum bounding rectangle of the at least one reference primitive;
aiming at each reference primitive in the at least one reference primitive, respectively determining auxiliary lines corresponding to different alignment modes based on the minimum circumscribed rectangle frame according to a preset alignment mode;
and predicting the auxiliary line corresponding to the closest alignment mode as an adsorption line according to the positions of the primitive to be adjusted and at least one reference primitive.
In an optional embodiment, the auxiliary line includes at least one of:
a straight line where a left frame of the minimum circumscribed rectangle frame corresponding to the left alignment mode is located;
a straight line where a right frame of the minimum circumscribed rectangle frame corresponding to the right alignment mode is located;
a straight line where the upper frame of the minimum circumscribed rectangle frame corresponding to the upper alignment mode is located;
a straight line where a lower frame of the minimum circumscribed rectangular frame corresponding to the lower alignment mode is located;
a transverse center line where the center point of the minimum circumscribed rectangle frame corresponding to the transverse centering alignment mode is located;
and the longitudinal center line of the center point of the minimum circumscribed rectangular frame corresponding to the longitudinal centered alignment mode.
An optional implementation manner is that, according to the positions of the primitive to be adjusted and at least one reference primitive, the auxiliary line corresponding to the closest alignment manner is predicted to be the adsorption line, and the method includes:
determining a measuring point with the shortest distance to an auxiliary line corresponding to the alignment mode in the graphics primitive to be adjusted according to each alignment mode of each reference graphics primitive in the at least one reference graphics primitive, and calculating the distance between the measuring point and the auxiliary line corresponding to the alignment mode;
and determining the alignment mode corresponding to the shortest distance in the distances as the closest alignment mode, and predicting the auxiliary line corresponding to the closest alignment mode as the adsorption line.
An optional implementation manner is that, adjusting the position of the primitive to be adjusted until the alignment position in the primitive to be adjusted overlaps with the adsorption line of the target reference primitive, the method further includes:
monitoring an instruction for moving a primitive to be adjusted, and determining the moving speed and/or the displacement of the primitive to be adjusted;
when the moving speed is judged to be larger than a preset speed threshold value, the position of the primitive to be adjusted is adjusted according to the moving speed, and/or when the displacement is judged to be larger than a preset displacement threshold value, the position of the primitive to be adjusted is adjusted according to the displacement;
otherwise, judging the instruction for moving the primitive to be adjusted as an invalid instruction.
In a second aspect, the present application provides a primitive alignment apparatus, including:
the calculation module is used for monitoring the displacement of the primitive to be adjusted and respectively calculating the distance between the primitive to be adjusted and each reference primitive positioned on the same page;
the generating module is used for respectively predicting an alignment mode of at least one reference primitive when monitoring at least one reference primitive of which the distance from the primitive to be adjusted is smaller than a first threshold value, and generating an adsorption line corresponding to the alignment mode;
the positioning module is used for positioning the alignment position in the primitive to be adjusted according to the alignment mode corresponding to the adsorption line of the target reference primitive when the target reference primitive with the distance to the primitive to be adjusted smaller than a second threshold value is monitored;
and the adjusting module is used for adjusting the position of the primitive to be adjusted until the alignment position in the primitive to be adjusted is overlapped with the adsorption line of the target reference primitive.
In a third aspect, the present application provides a primitive alignment apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements, when executing the computer program:
monitoring the displacement of the primitive to be adjusted, and respectively calculating the distance between the primitive to be adjusted and each reference primitive positioned on the same page;
when at least one reference primitive with the distance to the primitive to be adjusted smaller than a first threshold value is monitored, respectively predicting the alignment mode of the at least one reference primitive and generating an adsorption line corresponding to the alignment mode;
when a target reference primitive with the distance to the primitive to be adjusted smaller than a second threshold value is monitored, positioning an alignment position in the primitive to be adjusted according to an alignment mode corresponding to an adsorption line of the target reference primitive;
and adjusting the position of the primitive to be adjusted until the alignment position in the primitive to be adjusted is overlapped with the adsorption line of the target reference primitive.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement:
monitoring the displacement of the primitive to be adjusted, and respectively calculating the distance between the primitive to be adjusted and each reference primitive positioned on the same page;
when at least one reference primitive with the distance to the primitive to be adjusted smaller than a first threshold value is monitored, respectively predicting the alignment mode of the at least one reference primitive and generating an adsorption line corresponding to the alignment mode;
when a target reference primitive with the distance to the primitive to be adjusted smaller than a second threshold value is monitored, positioning an alignment position in the primitive to be adjusted according to an alignment mode corresponding to an adsorption line of the target reference primitive;
and adjusting the position of the primitive to be adjusted until the alignment position in the primitive to be adjusted is overlapped with the adsorption line of the target reference primitive.
According to the method, the distance between the primitive to be adjusted and each reference primitive is monitored, the adsorption line corresponding to the alignment mode of at least one reference primitive is generated when the distance is smaller than the first threshold, and when the distance is smaller than the second threshold, the position of the primitive to be adjusted is adjusted to be aligned with the reference primitive according to the corresponding adsorption line, so that automatic alignment of the primitives is realized, and the problems of inaccurate alignment, time consumption and labor consumption caused by manual alignment are solved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of a primitive alignment method according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of an alignment method according to an embodiment of the present disclosure;
FIG. 3 is a diagram illustrating an alignment position of a primitive to be adjusted according to an embodiment of the present disclosure;
fig. 4 is a flowchart of a method for calculating a distance between a primitive to be adjusted and a reference primitive according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of a reference point in a primitive alignment process according to an embodiment of the present disclosure;
fig. 6 is a flowchart of a method for generating an adsorption line according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of an absorption line in a primitive alignment process according to an embodiment of the present disclosure;
fig. 8 is a schematic diagram of a primitive alignment apparatus according to an embodiment of the present disclosure;
fig. 9 is a schematic diagram of a primitive alignment apparatus according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The application scenario described in the embodiment of the present application is for more clearly illustrating the technical solution of the embodiment of the present application, and does not form a limitation on the technical solution provided in the embodiment of the present application, and it can be known by a person skilled in the art that with the occurrence of a new application scenario, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems. In the description of the present application, the term "plurality" means two or more unless otherwise specified.
With the popularization of mobile terminal devices, a large number of small programs or applications are emerging in the application market of the mobile terminal devices, wherein applications capable of realizing a graphic editing function are more and more popular with users, generally, the applications capable of realizing the graphic editing function can provide customized templates, primitive lists and other materials for users, meanwhile, the functions of zooming, rotating, editing characters and the like of primitives are supported, and the users can make personal electronic business cards and posters for picture refinement and the like after simple learning.
At present, when a user needs to perform small-amplitude position alignment adjustment on a certain primitive, one generally adopted method is to enlarge an area where the primitive is located, so as to assist the user in adjusting the position of the primitive, and in this case, the condition that the primitive display is fuzzy sometimes caused by the limitation of the size of a display screen of a mobile terminal or the setting of pixels, so that the user is not convenient to identify and operate the primitive; in another mode, the primitive is dragged by means of a reference line or a grid line, so that the position of the primitive is adjusted, under the condition, a user sometimes difficultly grasps the degree of the primitive adjustment, the position of the primitive is greatly deviated due to the fact that the speed of dragging the primitive is too high, or the speed of dragging the primitive is too low, the position of the primitive is not obviously changed, the user needs to repeatedly try and continuously adjust the position of the primitive, the whole process is time-consuming and labor-consuming, and the user experience is poor.
In order to solve the above problem, the present application provides a primitive alignment method, where an execution subject of the method includes but is not limited to at least one of a server, a terminal, and other electronic devices that can be configured to execute the method provided by the embodiments of the present application. In other words, the primitive alignment method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The server may be an independent server, or a cloud server that provides basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Referring to fig. 1, an embodiment of the present application provides a flowchart of a primitive alignment method, as shown in fig. 1, the primitive alignment method includes:
step 101, monitoring the displacement of a primitive to be adjusted, and respectively calculating the distance between the primitive to be adjusted and each reference primitive located on the same page;
in the embodiment of the present application, the primitive is a short form of a graphic element, the page may be any graphic editing page, and the page may include a plurality of graphic elements such as a button element, a prompt box, an editing box, and a picture.
The primitive to be adjusted refers to a graphic element which moves in a page, and the reference primitive refers to a graphic element which does not move and has a fixed position in the page.
In the implementation, the operations of mouse clicking, mouse dragging and the like of a user are monitored to monitor whether the primitive to be adjusted is displaced, and if the primitive to be adjusted is monitored to be displaced, the distances between the primitive to be adjusted and all reference primitives positioned on the same page are calculated.
102, when monitoring at least one reference primitive of which the distance from the primitive to be adjusted is smaller than a first threshold value, respectively predicting an alignment mode of the at least one reference primitive and generating an adsorption line corresponding to the alignment mode;
in the embodiment of the present application, the value of the first threshold is not limited, and may be set according to actual requirements, for example, the first threshold is set to be 5 centimeters, 8 centimeters, and the like.
In the process of aligning the primitives, when the distance between the primitive to be adjusted and at least one reference primitive is monitored to be gradually reduced to a first threshold value, the at least one reference primitive is judged to be possibly the primitive to be aligned with the primitive to be adjusted, and adsorption lines corresponding to the at least one reference primitive are respectively generated.
When an adsorption line corresponding to the primitive to be adjusted and the reference primitive is generated for each reference primitive in the at least one reference primitive, firstly predicting an alignment mode of the primitive to be adjusted and the reference primitive according to a position relation of the reference primitive and the primitive to be adjusted, and then generating the adsorption line corresponding to the alignment mode according to the predicted alignment mode.
The absorption line may be a straight line, a radial line, a line segment, or other various forms, the direction of the absorption line is not limited in the embodiment of the present application, and the absorption line may be a horizontal line in a horizontal direction, a vertical line in a vertical direction, or an oblique line inclined in a certain direction.
As shown in fig. 2, the above alignment means includes, but is not limited to, left alignment, right alignment, up alignment, down alignment, and transverse center alignment, i.e., longitudinal center alignment.
103, when a target reference primitive with a distance smaller than a second threshold value from the primitive to be adjusted is monitored, positioning an alignment position in the primitive to be adjusted according to an alignment mode corresponding to an adsorption line of the target reference primitive;
in this embodiment of the application, specific values of the second threshold are not limited, but it should be noted that the values of the second threshold need to be smaller than the values of the first threshold.
In detail, when it is monitored that the distance between the primitive to be adjusted and the target reference primitive is further reduced to a second threshold, the alignment position in the primitive to be adjusted is positioned according to the adsorption line corresponding to the generated target reference primitive and the alignment mode corresponding to the adsorption line, wherein the alignment position in the primitive to be adjusted is the edge point of the primitive to be adjusted corresponding to the alignment mode.
Specifically, as shown in fig. 3, the primitive to be adjusted is left-aligned with the target reference primitive, and the adsorption line is generated on the left edge line of the target reference primitive, for example, at this time, the alignment position of the primitive to be adjusted is selected as the left edge point a of the primitive to be adjusted.
It should be noted that, because the value of the second threshold is smaller than the value of the first threshold, when the distance between the primitive to be adjusted and the target reference primitive is reduced to the second threshold, an adsorption line corresponding to the target reference primitive is necessarily generated in advance.
Step 104, adjusting the position of the primitive to be adjusted until the alignment position in the primitive to be adjusted is overlapped with the adsorption line of the target reference primitive;
in the implementation, since the alignment position of the primitive to be adjusted is determined according to the alignment mode corresponding to the adsorption line of the target reference primitive, the alignment position of the primitive to be adjusted is overlapped with the adsorption line of the target primitive, so that the alignment of the primitive to be adjusted and the target reference primitive can be realized.
According to the method, the distance between the primitive to be adjusted and the reference primitive is calculated in real time, when the distance is reduced to the first threshold value, the adsorption line corresponding to the alignment mode of the reference primitive is generated, when the distance is further reduced to the second threshold value, the alignment position of the primitive to be adjusted is determined according to the alignment mode, the position of the primitive to be adjusted is adjusted according to the alignment position and the adsorption line, the effect of automatic alignment of the primitive to be adjusted and the reference primitive is achieved, a user does not need to manually adjust or move the primitive to be adjusted repeatedly, and therefore the primitive alignment operation efficiency and the user operation experience are improved.
As an optional implementation manner, in order to prevent an incorrect operation caused by the problem of hand sliding, the adjusting method further includes, after adjusting the position of the primitive to be adjusted until the alignment position in the primitive to be adjusted overlaps with the adsorption line of the target reference primitive:
monitoring an instruction for moving a primitive to be adjusted, and determining the moving speed and/or the displacement of the primitive to be adjusted;
when the moving speed is judged to be larger than a preset speed threshold value, the position of the primitive to be adjusted is adjusted according to the moving speed, and/or when the displacement is judged to be larger than a preset displacement threshold value, the position of the primitive to be adjusted is adjusted according to the displacement;
otherwise, judging the instruction for moving the primitive to be adjusted as an invalid instruction.
In implementation, after a primitive to be adjusted is aligned with a target reference primitive, when the movement of the primitive to be adjusted of a user is monitored, firstly, the movement speed and/or the displacement of the primitive to be adjusted is obtained, whether the operation of the user is a misoperation is judged according to the movement speed and/or the displacement, if the movement speed is greater than a preset speed threshold and/or the displacement is greater than a preset displacement threshold, the operation of the user is judged to be an effective operation, and the position of the primitive to be adjusted is adjusted according to the movement speed and/or the displacement of the corresponding primitive to be adjusted; otherwise, judging that the operation of the user is invalid operation, and not adjusting the position of the primitive to be adjusted.
In the embodiment of the application, the values of the preset speed threshold and the preset displacement threshold are not limited, and can be adjusted according to actual requirements.
It should be noted that the moving the primitive to be adjusted may only include moving the primitive to be adjusted aligned with the target reference primitive to a position not aligned with the target reference primitive, or may also include moving the primitive to be adjusted while maintaining alignment with the target reference primitive, for example, moving the primitive to be adjusted up and down while maintaining left alignment with the target reference primitive.
According to the method, compared with the method that the user moves the aligned primitive to be adjusted and the misaligned primitive to be adjusted, the user needs higher moving speed and/or larger displacement, the phenomenon of hand slip can be effectively prevented, and larger position deviation is avoided when the primitive to be adjusted is moved.
Referring to fig. 4, the following describes in detail a method for calculating distances between the primitive to be adjusted and the reference primitives located on the same page in step 101, and calculates the distances between the primitive to be adjusted and the reference primitives located on the same page, including the following steps:
step 401, establishing a coordinate system by taking any point in the page as a coordinate origin;
in the implementation, a coordinate system is established first, and the distance between the primitive to be adjusted and the reference primitive is calculated based on the coordinate system.
Step 402, selecting a reference point on each of the primitives to be adjusted and the reference primitive, and determining a distance between the primitive to be adjusted and the reference primitive according to the coordinate value of the reference point of the primitive to be adjusted and the coordinate value of the reference point of the reference primitive;
in the implementation, when selecting the primitive to be adjusted and the reference point on each reference primitive, an optional implementation manner is to determine the primitive to be adjusted and the reference point on each reference primitive according to a predefined reference point position, for example, predefined to use the center point of the primitive as the reference point of the primitive; another optional implementation manner is to obtain the edge contour of the primitive to be adjusted and each reference primitive by using an edge detection algorithm, and determine the corresponding reference point according to the edge contour, for example, using any vertex in the edge contour map as the reference point of the corresponding primitive.
As an optional implementation manner, selecting a reference point on the primitive to be adjusted and the reference primitive respectively includes:
respectively determining the edge outlines of the primitive to be adjusted and the reference primitive by utilizing an edge detection algorithm;
selecting a first point in the edge contour point set of the primitive to be adjusted, and selecting a second point in the edge contour point set of the reference primitive, so that the distance between the first point and the second point is the closest;
and determining the first point as a reference point of the primitive to be adjusted, and determining the second point as a reference point of the reference primitive.
It should be noted that the reference points selected on the primitive to be adjusted are selected according to the corresponding reference primitives, and the reference points selected on the primitive to be adjusted may be the same or different for different reference primitives.
It should be noted that, if there are multiple groups of first points and second points in the edge contour point set of the primitive to be adjusted and the edge contour point set of the reference primitive, so that the distance between the first point and the second point is the closest, any one of the groups of first points and second points is selected, the first point is determined as the reference point of the primitive to be adjusted, and the second point is determined as the reference point of the reference primitive.
As shown in fig. 5, in the edge contour point set of the primitive to be adjusted, the first point of the reference primitive 1 is a point B in the graph, and the first point of the reference primitive 1 is a point C in the graph, when selecting the reference point on the primitive to be adjusted, the point B is selected as the reference point of the primitive to be adjusted for the reference primitive 1, and the point C is selected as the reference point of the primitive to be adjusted for the reference primitive 2.
Referring to fig. 6, the method for generating the adsorption line in step 102 is explained in detail as follows:
as an optional implementation manner, predicting an alignment manner with the at least one reference primitive, and generating a suction line corresponding to the alignment manner respectively includes the following steps:
601, generating a minimum circumscribed rectangle frame of the at least one reference primitive;
step 602, for each reference primitive in the at least one reference primitive, determining an auxiliary line corresponding to each alignment mode based on the minimum circumscribed rectangle frame according to a preset alignment mode;
step 603, predicting the auxiliary line corresponding to the closest alignment mode as an adsorption line according to the positions of the primitive to be adjusted and at least one reference primitive.
In the implementation, there may be a plurality of auxiliary lines corresponding to various alignment manners in step 602, and as an optional implementation, the auxiliary lines include at least one of the following:
a straight line (first auxiliary line) where the left frame of the minimum circumscribed rectangle frame corresponding to the left alignment mode is located;
a straight line (second auxiliary line) where a right frame of the minimum circumscribed rectangle frame corresponding to the right alignment mode is located;
a straight line (third auxiliary line) where the upper frame of the minimum circumscribed rectangle frame corresponding to the upper alignment pattern is located;
a straight line (fourth auxiliary line) on which the lower frame of the minimum bounding rectangle corresponding to the lower alignment mode is located;
a horizontal central line (a fifth auxiliary line) where the central point of the minimum circumscribed rectangle frame corresponding to the horizontal centering alignment mode is located;
and a longitudinal central line (sixth auxiliary line) where the central point of the minimum circumscribed rectangular frame corresponding to the longitudinal centered alignment mode is located.
The six auxiliary lines can assist in achieving the effects of left alignment, right alignment, upper alignment, lower alignment and center alignment between the graphic primitive to be adjusted and the reference graphic primitive, and in practical application, the types of the auxiliary lines can be increased or decreased according to actual needs.
As an optional implementation manner, in step 603, predicting, according to the positions of the primitive to be adjusted and the at least one reference primitive, that the auxiliary line corresponding to the closest alignment manner is the adsorption line includes:
determining a measuring point with the shortest distance to an auxiliary line corresponding to the alignment mode in the graphics primitive to be adjusted according to each alignment mode of each reference graphics primitive in the at least one reference graphics primitive, and calculating the distance between the measuring point and the auxiliary line corresponding to the alignment mode;
and for each reference primitive in the at least one reference primitive, determining the alignment mode corresponding to the shortest distance in the distances as the closest alignment mode, and predicting the auxiliary line corresponding to the closest alignment mode as the adsorption line.
In the embodiment of the invention, if the alignment mode corresponding to the shortest distance is a left alignment mode, determining a first auxiliary line where a left frame of a minimum circumscribed rectangular frame corresponding to the left alignment mode is located as an adsorption line; if the alignment mode corresponding to the shortest distance is the upper alignment mode, the third auxiliary line where the upper border of the minimum circumscribed rectangular frame corresponding to the upper alignment mode is located is determined as the adsorption line, and when the alignment mode corresponding to the shortest distance is the other alignment mode, the method for determining the adsorption line is similar to that, and is not repeated here.
As shown in fig. 7, an embodiment of the present application provides a schematic diagram of an adsorption line in a primitive alignment process, where in a graphics editing page shown in fig. 7, a primitive to be adjusted, a reference primitive 1, and a reference primitive 2 are included, taking three positions of the primitive to be adjusted in a moving process as an example, the position 1 is an initial position of the primitive to be adjusted, when the primitive to be adjusted moves to the position 2, a distance between the primitive to be adjusted and the reference primitive 1 is reduced to a first threshold, and is determined according to a distance between a measurement point in the primitive to be adjusted corresponding to different alignment modes and an auxiliary line in the reference primitive 1, and when an alignment mode corresponding to the shortest distance is a left alignment mode, a first auxiliary line corresponding to the reference primitive is used as the adsorption line, and the adsorption line 1 as shown in the figure is generated on the reference primitive 1;
when the primitive to be adjusted moves to the position 3, the distance between the primitive to be adjusted and the reference primitive 1 is reduced to a first threshold value, the distance is determined according to the distance between a measuring point in the primitive to be adjusted corresponding to different alignment modes and an auxiliary line in the reference primitive 1, when the alignment mode corresponding to the shortest distance is a lower alignment mode, a fourth auxiliary line corresponding to the reference primitive is used as an adsorption line, and an adsorption line 2 as shown in the figure is generated on the reference primitive 1;
since the distance between the primitive to be adjusted and the reference primitive 2 does not satisfy the first threshold value during the movement of the primitive to be adjusted, no adsorption line is generated on the reference primitive 2.
The following describes an embodiment of a primitive alignment apparatus with reference to the drawings.
Fig. 8 is a schematic diagram of a primitive alignment apparatus according to an embodiment of the present invention, as shown in fig. 7, the apparatus includes:
a calculating module 801, configured to monitor that a primitive to be adjusted displaces, and calculate distances between the primitive to be adjusted and reference primitives located on the same page respectively;
a generating module 802, configured to respectively predict an alignment manner of at least one reference primitive when monitoring at least one reference primitive whose distance from the primitive to be adjusted is smaller than a first threshold, and generate an adsorption line corresponding to the alignment manner;
a positioning module 803, configured to, when a target reference primitive whose distance from the primitive to be adjusted is smaller than a second threshold is monitored, position an alignment position in the primitive to be adjusted according to an alignment manner corresponding to an adsorption line of the target reference primitive;
the adjusting module 804 is configured to adjust the position of the primitive to be adjusted until the alignment position in the primitive to be adjusted overlaps with the absorption line of the target reference primitive.
Optionally, the calculating module 801 is configured to calculate distances between the primitive to be adjusted and the reference primitives located on the same page respectively, and includes:
establishing a coordinate system by taking any point in the page as a coordinate origin;
and respectively selecting a reference point on the primitive to be adjusted and the reference primitive aiming at each reference primitive in the reference primitives, and determining the distance between the primitive to be adjusted and the reference primitive according to the coordinate value of the reference point of the primitive to be adjusted and the coordinate value of the reference point of the reference primitive.
Optionally, the calculating module 801 is configured to select a reference point on the primitive to be adjusted and the reference primitive, respectively, where the selecting includes:
respectively determining the edge outlines of the primitive to be adjusted and the reference primitive by utilizing an edge detection algorithm;
selecting a first point in the edge contour point set of the primitive to be adjusted, and selecting a second point in the edge contour point set of the reference primitive, so that the distance between the first point and the second point is the closest;
and determining the first point as a reference point of the primitive to be adjusted, and determining the second point as a reference point of the reference primitive.
Optionally, the generating module 802 is configured to respectively predict an alignment manner of the at least one reference primitive and generate an absorption line corresponding to the alignment manner, and includes:
generating a minimum bounding rectangle of the at least one reference primitive;
aiming at each reference primitive in the at least one reference primitive, respectively determining auxiliary lines corresponding to different alignment modes based on the minimum circumscribed rectangle frame according to a preset alignment mode;
and predicting the auxiliary line corresponding to the closest alignment mode as an adsorption line according to the positions of the primitive to be adjusted and at least one reference primitive.
Optionally, the auxiliary line includes at least one of:
a straight line where a left frame of the minimum circumscribed rectangle frame corresponding to the left alignment mode is located;
a straight line where a right frame of the minimum circumscribed rectangle frame corresponding to the right alignment mode is located;
a straight line where the upper frame of the minimum circumscribed rectangle frame corresponding to the upper alignment mode is located;
a straight line where a lower frame of the minimum circumscribed rectangular frame corresponding to the lower alignment mode is located;
a transverse center line where the center point of the minimum circumscribed rectangle frame corresponding to the transverse centering alignment mode is located;
and the longitudinal center line of the center point of the minimum circumscribed rectangular frame corresponding to the longitudinal centered alignment mode.
Optionally, the generating module 802 is configured to predict, according to the positions of the primitive to be adjusted and the at least one reference primitive, that the auxiliary line corresponding to the closest alignment manner is the adsorption line, and includes:
determining a measuring point with the shortest distance to an auxiliary line corresponding to the alignment mode in the graphics primitive to be adjusted according to each alignment mode of each reference graphics primitive in the at least one reference graphics primitive, and calculating the distance between the measuring point and the auxiliary line corresponding to the alignment mode;
and determining the alignment mode corresponding to the shortest distance in the distances as the closest alignment mode, and predicting the auxiliary line corresponding to the closest alignment mode as the adsorption line.
Optionally, the generating module 802 is configured to adjust the position of the primitive to be adjusted until the alignment position in the primitive to be adjusted overlaps with the adsorption line of the target reference primitive, and further configured to:
monitoring an instruction for moving a primitive to be adjusted, and determining the moving speed and/or the displacement of the primitive to be adjusted;
when the moving speed is judged to be larger than a preset speed threshold value, the position of the primitive to be adjusted is adjusted according to the moving speed, and/or when the displacement is judged to be larger than a preset displacement threshold value, the position of the primitive to be adjusted is adjusted according to the displacement;
otherwise, judging the instruction for moving the primitive to be adjusted as an invalid instruction.
Based on the same application concept, an embodiment of the present invention further provides a primitive alignment apparatus, and the following describes the primitive alignment apparatus in the embodiment of the present invention with reference to the drawings.
As will be appreciated by one skilled in the art, aspects of the present application may be embodied as a system, method or program product. Accordingly, various aspects of the present application may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
In some possible embodiments, an apparatus according to the present application may include at least one processor, and at least one memory. The memory has stored therein program code which, when executed by the processor, causes the processor to perform the steps of the primitive alignment methods according to various exemplary embodiments of the present application described above in this specification.
An apparatus 900 according to this embodiment of the present application is described below with reference to fig. 9. The device 900 shown in fig. 9 is only an example and should not bring any limitations to the functionality or scope of use of the embodiments of the present application.
As shown in fig. 9, the device 900 is in the form of a general purpose device. The components of device 900 may include, but are not limited to: the at least one processor 901, the at least one memory 902, and the bus 903 connecting the various system components (including the memory 902 and the processor 901), wherein the memory stores program code that, when executed by the processor, causes the processor to perform the steps of:
monitoring the displacement of the primitive to be adjusted, and respectively calculating the distance between the primitive to be adjusted and each reference primitive positioned on the same page;
when at least one reference primitive with the distance to the primitive to be adjusted smaller than a first threshold value is monitored, respectively predicting the alignment mode of the at least one reference primitive and generating an adsorption line corresponding to the alignment mode;
when a target reference primitive with the distance to the primitive to be adjusted smaller than a second threshold value is monitored, positioning an alignment position in the primitive to be adjusted according to an alignment mode corresponding to an adsorption line of the target reference primitive;
and adjusting the position of the primitive to be adjusted until the alignment position in the primitive to be adjusted is overlapped with the adsorption line of the target reference primitive.
Bus 903 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
The memory 902 may include readable media in the form of volatile memory, such as Random Access Memory (RAM)9021 and/or cache memory 9022, and may further include Read Only Memory (ROM) 9023.
Memory 902 may also include a program/utility 9025 having a set (at least one) of program modules 9024, such program modules 9024 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Device 900 can also communicate with one or more external devices 904 (e.g., keyboard, pointing device, etc.), with one or more devices that enable a user to interact with device 900, and/or with any device (e.g., router, modem, etc.) that enables device 900 to communicate with one or more other devices. Such communication may occur via input/output (I/O) interfaces 905. Moreover, device 900 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network such as the Internet) via network adapter 906. As shown, the network adapter 906 communicates with the other modules for the device 900 over the bus 903. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with device 900, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Optionally, the processor is configured to calculate distances between the primitive to be adjusted and reference primitives located on the same page respectively, and includes:
establishing a coordinate system by taking any point in the page as a coordinate origin;
and respectively selecting a reference point on the primitive to be adjusted and the reference primitive aiming at each reference primitive in the reference primitives, and determining the distance between the primitive to be adjusted and the reference primitive according to the coordinate value of the reference point of the primitive to be adjusted and the coordinate value of the reference point of the reference primitive.
Optionally, the processor is configured to select a reference point on the primitive to be adjusted and the reference primitive, respectively, and includes:
respectively determining the edge outlines of the primitive to be adjusted and the reference primitive by utilizing an edge detection algorithm;
selecting a first point in the edge contour point set of the primitive to be adjusted, and selecting a second point in the edge contour point set of the reference primitive, so that the distance between the first point and the second point is the closest;
and determining the first point as a reference point of the primitive to be adjusted, and determining the second point as a reference point of the reference primitive.
Optionally, the processor is configured to predict alignment manners with the at least one reference primitive, and generate a suction line corresponding to the alignment manners, and includes:
generating a minimum bounding rectangle of the at least one reference primitive;
aiming at each reference primitive in the at least one reference primitive, respectively determining auxiliary lines corresponding to different alignment modes on the basis of the minimum circumscribed rectangle frame according to a preset alignment mode;
and predicting the auxiliary line corresponding to the closest alignment mode as an adsorption line according to the positions of the primitive to be adjusted and at least one reference primitive.
Optionally, the auxiliary line includes at least one of:
a straight line where a left frame of the minimum circumscribed rectangle frame corresponding to the left alignment mode is located;
a straight line where a right frame of the minimum circumscribed rectangle frame corresponding to the right alignment mode is located;
a straight line where the upper frame of the minimum circumscribed rectangle frame corresponding to the upper alignment mode is located;
a straight line where a lower frame of the minimum circumscribed rectangular frame corresponding to the lower alignment mode is located;
a transverse center line where the center point of the minimum circumscribed rectangle frame corresponding to the transverse centering alignment mode is located;
and the longitudinal center line of the center point of the minimum circumscribed rectangular frame corresponding to the longitudinal centered alignment mode.
Optionally, the processor is configured to predict, according to the positions of the primitive to be adjusted and the at least one reference primitive, that the auxiliary line corresponding to the closest alignment mode is the adsorption line, and includes:
determining a measuring point with the shortest distance to an auxiliary line corresponding to the alignment mode in the graphics primitive to be adjusted according to each alignment mode of each reference graphics primitive in the at least one reference graphics primitive, and calculating the distance between the measuring point and the auxiliary line corresponding to the alignment mode;
and determining the alignment mode corresponding to the shortest distance in the distances as the closest alignment mode, and predicting the auxiliary line corresponding to the closest alignment mode as the adsorption line.
Optionally, the processor is configured to adjust the position of the primitive to be adjusted until the alignment position in the primitive to be adjusted overlaps with the adsorption line of the target reference primitive, and further includes:
monitoring an instruction for moving a primitive to be adjusted, and determining the moving speed and/or the displacement of the primitive to be adjusted;
when the moving speed is judged to be larger than a preset speed threshold value, the position of the primitive to be adjusted is adjusted according to the moving speed, and/or when the displacement is judged to be larger than a preset displacement threshold value, the position of the primitive to be adjusted is adjusted according to the displacement;
otherwise, judging the instruction for moving the primitive to be adjusted as an invalid instruction.
In some possible embodiments, aspects of a primitive alignment method provided herein may also be implemented in the form of a program product comprising program code for causing a computer device to perform the steps of a primitive alignment method according to various exemplary embodiments of the present application described above in this specification when the program product is run on the computer device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The program product for monitoring of embodiments of the present application may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a device. However, the program product of the present application is not so limited, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user device, partly on the user device, as a stand-alone software package, partly on the user device and partly on a remote device, or entirely on the remote device or server. In the case of remote devices, the remote devices may be connected to the user device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to external devices (e.g., through the internet using an internet service provider).
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, the features and functions of two or more units described above may be embodied in one unit, according to embodiments of the application. Conversely, the features and functions of one unit described above may be further divided into embodiments by a plurality of units.
Further, while the operations of the methods of the present application are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and block diagrams, and combinations of flows and blocks in the flowchart illustrations and block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method for primitive alignment, the method comprising:
monitoring the displacement of a primitive to be adjusted, and respectively calculating the distance between the primitive to be adjusted and each reference primitive positioned on the same page;
when at least one reference primitive with the distance to the primitive to be adjusted smaller than a first threshold value is monitored, respectively predicting the alignment mode of the at least one reference primitive and generating an adsorption line corresponding to the alignment mode;
when a target reference primitive with the distance to the primitive to be adjusted smaller than a second threshold value is monitored, positioning an alignment position in the primitive to be adjusted according to an alignment mode corresponding to an adsorption line of the target reference primitive;
and adjusting the position of the primitive to be adjusted until the alignment position in the primitive to be adjusted is overlapped with the adsorption line of the target reference primitive.
2. The method according to claim 1, wherein calculating the distance between the primitive to be adjusted and each reference primitive located on the same page separately comprises:
establishing a coordinate system by taking any point in the page as a coordinate origin;
and respectively selecting a reference point on the primitive to be adjusted and the reference primitive aiming at each reference primitive in the reference primitives, and determining the distance between the primitive to be adjusted and the reference primitive according to the coordinate value of the reference point of the primitive to be adjusted and the coordinate value of the reference point of the reference primitive.
3. The method according to claim 2, wherein selecting a reference point on each of the primitive to be adjusted and the reference primitive comprises:
respectively determining the edge outlines of the primitive to be adjusted and the reference primitive by utilizing an edge detection algorithm;
selecting a first point in the edge contour point set of the primitive to be adjusted, and selecting a second point in the edge contour point set of the reference primitive, so that the distance between the first point and the second point is the closest;
and determining the first point as a reference point of the primitive to be adjusted, and determining the second point as a reference point of the reference primitive.
4. The method according to any one of claims 1 to 3, wherein predicting an alignment with the at least one reference primitive and generating a adsorption line corresponding to the alignment, respectively, comprises:
generating a minimum bounding rectangle for the at least one reference primitive;
aiming at each reference primitive in the at least one reference primitive, respectively determining auxiliary lines corresponding to different alignment modes based on the minimum circumscribed rectangle frame according to a preset alignment mode;
and predicting the auxiliary line corresponding to the closest alignment mode as an adsorption line according to the positions of the primitive to be adjusted and at least one reference primitive.
5. The method of claim 4, wherein the auxiliary lines comprise at least one of:
a straight line where a left frame of the minimum circumscribed rectangular frame corresponding to the left alignment mode is located;
a straight line where a right frame of the minimum circumscribed rectangle frame corresponding to the right alignment mode is located;
a straight line where an upper frame of the minimum circumscribed rectangle frame corresponding to the upper alignment mode is located;
a straight line where a lower frame of the minimum circumscribed rectangular frame corresponding to the lower alignment mode is located;
a transverse center line where the center point of the minimum circumscribed rectangle frame corresponding to the transverse centering alignment mode is located;
and the longitudinal center line of the center point of the minimum circumscribed rectangular frame corresponding to the longitudinal centered alignment mode.
6. The method according to claim 4, wherein predicting the auxiliary line corresponding to the closest alignment as the absorption line according to the positions of the primitive to be adjusted and the at least one reference primitive comprises:
determining a measuring point with the shortest distance to an auxiliary line corresponding to the alignment mode in the graphics primitive to be adjusted according to each alignment mode of each reference graphics primitive in the at least one reference graphics primitive, and calculating the distance between the measuring point and the auxiliary line corresponding to the alignment mode;
and determining the alignment mode corresponding to the shortest distance in the distances as the closest alignment mode, and predicting the auxiliary line corresponding to the closest alignment mode as the adsorption line.
7. The method according to claim 1, wherein adjusting the position of the primitive to be adjusted until the alignment position in the primitive to be adjusted overlaps with the adsorption line of the target reference primitive, further comprises:
monitoring an instruction for moving a primitive to be adjusted, and determining the moving speed and/or the displacement of the primitive to be adjusted;
when the moving speed is judged to be greater than a preset speed threshold value, adjusting the position of the primitive to be adjusted according to the moving speed, and/or when the displacement is judged to be greater than a preset displacement threshold value, adjusting the position of the primitive to be adjusted according to the displacement;
otherwise, judging the instruction for moving the primitive to be adjusted as an invalid instruction.
8. A primitive alignment apparatus, comprising:
the calculation module is used for monitoring the displacement of the primitive to be adjusted and respectively calculating the distance between the primitive to be adjusted and each reference primitive positioned on the same page;
the generating module is used for respectively predicting an alignment mode of at least one reference primitive when monitoring at least one reference primitive of which the distance from the primitive to be adjusted is smaller than a first threshold value, and generating an adsorption line corresponding to the alignment mode;
the positioning module is used for positioning an alignment position in the primitive to be adjusted according to an alignment mode corresponding to an adsorption line of the target reference primitive when the target reference primitive of which the distance from the primitive to be adjusted is smaller than a second threshold value is monitored;
and the adjusting module is used for adjusting the position of the primitive to be adjusted until the alignment position in the primitive to be adjusted is overlapped with the adsorption line of the target reference primitive.
9. A primitive alignment device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any of claims 1-7 when executing the computer program.
10. A computer-readable storage medium, having computer program instructions stored thereon, which, when executed by a processor, implement the steps of the method of any one of claims 1-7.
CN202210189863.2A 2022-02-28 2022-02-28 Primitive alignment method, device and equipment Pending CN114579238A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210189863.2A CN114579238A (en) 2022-02-28 2022-02-28 Primitive alignment method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210189863.2A CN114579238A (en) 2022-02-28 2022-02-28 Primitive alignment method, device and equipment

Publications (1)

Publication Number Publication Date
CN114579238A true CN114579238A (en) 2022-06-03

Family

ID=81771283

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210189863.2A Pending CN114579238A (en) 2022-02-28 2022-02-28 Primitive alignment method, device and equipment

Country Status (1)

Country Link
CN (1) CN114579238A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040261012A1 (en) * 2003-06-17 2004-12-23 Balsiger Fred W. Snaplines for control object positioning
US20140095986A1 (en) * 2012-09-30 2014-04-03 Vinay Krishnaswamy Baseline Alignment
US20180004401A1 (en) * 2016-06-29 2018-01-04 Adobe Systems Incorporated Objects Alignment and Distribution Layout
CN108920053A (en) * 2018-06-29 2018-11-30 维沃移动通信有限公司 A kind of alignment schemes and mobile terminal
CN110389810A (en) * 2019-07-31 2019-10-29 阿里巴巴集团控股有限公司 A kind of method, device and equipment for quickly putting UI control on virtual canvas
CN111352545A (en) * 2019-05-07 2020-06-30 鸿合科技股份有限公司 Automatic adsorption method of interactive service and related equipment
CN112764654A (en) * 2021-01-29 2021-05-07 北京达佳互联信息技术有限公司 Component adsorption operation method and device, terminal and storage medium
CN113626018A (en) * 2021-07-06 2021-11-09 深圳点猫科技有限公司 Application interface design method and device, electronic equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040261012A1 (en) * 2003-06-17 2004-12-23 Balsiger Fred W. Snaplines for control object positioning
US20140095986A1 (en) * 2012-09-30 2014-04-03 Vinay Krishnaswamy Baseline Alignment
US20180004401A1 (en) * 2016-06-29 2018-01-04 Adobe Systems Incorporated Objects Alignment and Distribution Layout
CN108920053A (en) * 2018-06-29 2018-11-30 维沃移动通信有限公司 A kind of alignment schemes and mobile terminal
CN111352545A (en) * 2019-05-07 2020-06-30 鸿合科技股份有限公司 Automatic adsorption method of interactive service and related equipment
CN110389810A (en) * 2019-07-31 2019-10-29 阿里巴巴集团控股有限公司 A kind of method, device and equipment for quickly putting UI control on virtual canvas
CN112764654A (en) * 2021-01-29 2021-05-07 北京达佳互联信息技术有限公司 Component adsorption operation method and device, terminal and storage medium
CN113626018A (en) * 2021-07-06 2021-11-09 深圳点猫科技有限公司 Application interface design method and device, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WEIXIN_30655569: "拖动同级别元素显示辅助线,辅助对齐,吸附.", Retrieved from the Internet <URL:《http://www.cnblogs.com/loverows/p/7251684.html》> *
ZHANGZP: "用Vue3造个轮子吧:拖拽缩放组件,支持吸附对齐,实时参考线", Retrieved from the Internet <URL:《https://jujin.cn/pos/6942023400340586504t》> *

Similar Documents

Publication Publication Date Title
US11694461B2 (en) Optical character recognition method and apparatus, electronic device and storage medium
US20220114759A1 (en) Target detection method, electronic device and medium
CN108090916B (en) Method and apparatus for tracking the targeted graphical in video
US20180372852A1 (en) Method and apparatus for calibration between laser radar and camera, device and storage medium
US20200167568A1 (en) Image processing method, device, and storage medium
CN110929702A (en) Trajectory planning method and device, electronic equipment and storage medium
CN113570610B (en) Method and device for performing target segmentation on video by adopting semantic segmentation model
CN114063858B (en) Image processing method, image processing device, electronic equipment and storage medium
CN110914870A (en) Annotation generation for image networks
CN113705515A (en) Training of semantic segmentation model and generation method and equipment of high-precision map lane line
CN113657396A (en) Training method, translation display method, device, electronic equipment and storage medium
CN114579238A (en) Primitive alignment method, device and equipment
US20230048643A1 (en) High-Precision Map Construction Method, Apparatus and Electronic Device
CN111563453A (en) Method, apparatus, device and medium for determining table vertices
CN112987707A (en) Automatic driving control method and device for vehicle
EP4290452A1 (en) Data generation method and apparatus, and electronic device
CN115797533A (en) Model edge tracing method, device, equipment and storage medium
CN114564268A (en) Equipment management method and device, electronic equipment and storage medium
CN110647599B (en) Method and apparatus for displaying information
CN114581869A (en) Method and device for determining position of target object, electronic equipment and storage medium
CN113126866A (en) Object determination method and device, electronic equipment and storage medium
CN113744278A (en) Text detection method and device
Didar et al. eAR: An Edge-Assisted and Energy-Efficient Mobile Augmented Reality Framework
CN113901342B (en) Road network data processing method and device, electronic equipment and storage medium
CN115359227B (en) Fusion method and device of regional live-action map and lane-level map and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination