CN111753230B - Reference line processing method and device - Google Patents

Reference line processing method and device Download PDF

Info

Publication number
CN111753230B
CN111753230B CN202010533065.8A CN202010533065A CN111753230B CN 111753230 B CN111753230 B CN 111753230B CN 202010533065 A CN202010533065 A CN 202010533065A CN 111753230 B CN111753230 B CN 111753230B
Authority
CN
China
Prior art keywords
line segment
line
distance
determining
reference line
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.)
Active
Application number
CN202010533065.8A
Other languages
Chinese (zh)
Other versions
CN111753230A (en
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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010533065.8A priority Critical patent/CN111753230B/en
Publication of CN111753230A publication Critical patent/CN111753230A/en
Application granted granted Critical
Publication of CN111753230B publication Critical patent/CN111753230B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure discloses a reference line processing method, apparatus, electronic device, and computer-readable storage medium. The method comprises the following steps: acquiring at least one second webpage element positioned in the current editing page as a reference webpage element according to the position change of the first webpage element in the current editing page in the webpage editor; generating a first external rectangle according to the first webpage element, and generating a second external rectangle according to the reference webpage element; determining a first line segment according to the first circumscribed rectangle, and determining a second line segment according to the second circumscribed rectangle; and determining a reference line according to the first line segment and the second line segment, wherein the reference line is a line segment. According to the embodiment of the disclosure, the reference line is a line segment, so that confusion of the corresponding reference line when more page elements in the edited page can be avoided.

Description

Reference line processing method and device
Technical Field
The present disclosure relates to the technical field of browsers, and in particular, to a reference line processing method, a reference line processing device and a computer readable storage medium.
Background
The web page is a basic element constituting a website and is a platform for bearing various website applications. In particular, the web page is a plain text file containing hypertext markup language (Hyper Text Markup Language, HTML) tags. The text and the picture are two most basic elements forming a webpage, and in addition, the elements of the webpage also comprise audio, video, animation and programs.
In the prior art, a web page is often edited and produced by an HTML editor, for example, the various elements described above are added to the web page using the HTML editor. While adding elements through an HTML editor, reference lines are typically required to assist in the positioning or alignment of the elements.
However, in the prior art, the reference line drawn by the HTML editor is usually a straight line without a boundary, and when the page elements are more, the corresponding reference lines are more, which causes confusion in editing the page.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The technical problem solved by the present disclosure is to provide a reference line processing method, so as to at least partially solve the technical problem in the prior art that when there are more page elements, there are more corresponding reference lines, and the edited page is confused. Further, a reference line processing apparatus, a reference line processing hardware apparatus, a computer-readable storage medium, and a reference line processing terminal are provided.
In order to achieve the above object, according to one aspect of the present disclosure, there is provided the following technical solutions:
a reference line processing method, comprising:
acquiring at least one second webpage element positioned in a current editing page as a reference webpage element according to the position change of a first webpage element in the current editing page in a webpage editor;
generating a first external rectangle according to the first webpage element, and generating a second external rectangle according to the reference webpage element;
determining a first line segment according to the first circumscribed rectangle, and determining a second line segment according to the second circumscribed rectangle;
determining a reference line according to the first line segment and the second line segment; wherein the reference line is a line segment.
In order to achieve the above object, according to one aspect of the present disclosure, there is provided the following technical solutions:
a reference line processing apparatus comprising:
the webpage element acquisition module is used for acquiring at least one second webpage element positioned in the current editing page as a reference webpage element according to the position change of the first webpage element in the current editing page in the webpage editor;
the external rectangle generation module is used for generating a first external rectangle according to the first webpage element and generating a second external rectangle according to the reference webpage element;
The line segment determining module is used for determining a first line segment according to the first circumscribed rectangle and determining a second line segment according to the second circumscribed rectangle;
the reference line determining module is used for determining a reference line according to the first line segment and the second line segment; wherein the reference line is a line segment.
In order to achieve the above object, according to one aspect of the present disclosure, there is provided the following technical solutions:
an electronic device, comprising:
a memory for storing non-transitory computer readable instructions; and
a processor for executing the computer readable instructions such that the processor, when executed, implements the reference line processing method of any of the above.
In order to achieve the above object, according to one aspect of the present disclosure, there is provided the following technical solutions:
a computer readable storage medium storing non-transitory computer readable instructions which, when executed by a computer, cause the computer to perform the reference line processing method of any one of the preceding claims.
In order to achieve the above object, according to still another aspect of the present disclosure, there is further provided the following technical solutions:
a reference line processing terminal comprises any one of the reference line processing devices.
According to the embodiment of the disclosure, at least one second webpage element in a current editing page is obtained as a reference webpage element according to the position change of the first webpage element in the current editing page in the webpage editor, a first external rectangle is generated according to the first webpage element, a second external rectangle is generated according to the reference webpage element, a first line segment is determined according to the first external rectangle, a second line segment is determined according to the second external rectangle, a reference line is determined according to the first line segment and the second line segment, and the reference line is a line segment, so that confusion of the corresponding reference line when the number of the webpage elements in the editing page is large can be avoided.
The foregoing description is only an overview of the disclosed technology, and may be implemented in accordance with the disclosure of the present disclosure, so that the above-mentioned and other objects, features and advantages of the present disclosure can be more clearly understood, and the following detailed description of the preferred embodiments is given with reference to the accompanying drawings.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1a is a flow diagram of a reference line processing method according to one embodiment of the present disclosure;
FIG. 1b is a schematic diagram of a reference example provided in a reference line processing method according to one embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a reference line processing apparatus according to one embodiment of the present disclosure;
fig. 3 is a schematic structural view of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
Example 1
In order to solve the technical problem that the edited pages are disordered due to the fact that corresponding reference lines are more when page elements are more in the prior art, the embodiment of the disclosure provides a reference line processing method. As shown in fig. 1a, the reference line processing method mainly includes the following steps S11 to S14.
Step S11: and acquiring at least one second webpage element positioned in the current editing page as a reference webpage element according to the position change of the first webpage element in the current editing page in the webpage editor.
In order to distinguish between different web page elements, the web page element whose position is changed is defined herein as a first web page element, and the reference web page element of the first web page element is defined as a second web page element. The first webpage element and the second webpage element can be words, pictures, audio, video, animation, programs and the like. The shape thereof may be circular, rectangular, polygonal, etc., and is not particularly limited herein.
The web page editor may be a hypertext markup language (Hyper Text Markup Language, HTML) editor, such as an HTML5 editor, among others.
Specifically, the position change of a first webpage element in a current editing page in a webpage editor is monitored in real time, and when the position change of the first webpage element is detected, at least one second webpage element in the current editing page is obtained as a reference webpage element. The change in the position of the first web page element may be manifested as a movement or deformation of the first web page element, e.g., a user dragging the first web page element in the current editing page, thereby causing the first web page element to move or deform.
The deformation scene generated by the first webpage element includes dragging any side or any vertex of the first circumscribed rectangle to deform (for example, zoom in or zoom out, which may or may not be equal-scaled).
Step S12: and generating a first circumscribed rectangle according to the first webpage element, and generating a second circumscribed rectangle according to the reference webpage element.
In order to distinguish the circumscribed rectangles of different webpage elements herein, the circumscribed rectangle corresponding to the first webpage element is defined as a first circumscribed rectangle, and the circumscribed rectangle corresponding to the second webpage element is defined as a second circumscribed rectangle.
The bounding rectangle may be the smallest bounding rectangle, that is, the largest range of the two-dimensional shape (e.g., circle, line segment, polygon) corresponding to the web page element represented by the two-dimensional coordinates, specifically, the rectangle with the lower boundary defined by the largest abscissa, the smallest abscissa, the largest ordinate, and the smallest ordinate in each vertex of the given two-dimensional shape.
Step S13: and determining a first line segment according to the first circumscribed rectangle, and determining a second line segment according to the second circumscribed rectangle.
The first line segment may be one or more, and specifically may be at least one of four sides (including an upper side, a lower side, a left side and a right side) and two centerlines (including a horizontal centerline and a vertical centerline) of the first circumscribed rectangle. Similarly, the second line segment may also be one or more, and specifically may be at least one of four sides (including an upper side, a lower side, a left side, and a right side) and two centerlines (including a horizontal centerline and a vertical centerline) of the second external rectangle.
Step S14: determining a reference line according to the first line segment and the second line segment; wherein the reference line is a line segment.
The reference line may be determined according to a second line segment, specifically, may be a line corresponding to the second line segment, or a line with a preset distance from the second line segment, where the line is located outside the first circumscribed rectangle and the second circumscribed rectangle, and further, two endpoints of the reference line are determined according to two endpoints of the first line segment and two endpoints of the second line segment. Wherein the reference line comprises a horizontal reference line and/or a vertical reference line.
Wherein the reference line does not exceed the boundary line of the first circumscribed rectangle and/or the second circumscribed rectangle.
According to the embodiment, at least one second webpage element in a current editing page is obtained as a reference webpage element according to the position change of the first webpage element in the current editing page in the webpage editor, a first external rectangle is generated according to the first webpage element, a second external rectangle is generated according to the reference webpage element, a first line segment is determined according to the first external rectangle, a second line segment is determined according to the second external rectangle, a reference line is determined according to the first line segment and the second line segment, and the reference line is a line segment, so that confusion of the corresponding reference line when the number of the webpage elements in the editing page is large can be avoided.
In an alternative embodiment, step S14 specifically includes:
step S141: and determining a first distance between the line segments according to the first line segment and the second line segment.
The first line segment may have one or more, and the second line segment may have one or more, and when the first line segment and the second line segment are both one, the obtained first distance is also one, that is, the distance between the first line segment and the second line segment, and may specifically be the shortest distance between the first line segment and the second line segment, including a vertical distance and a horizontal distance. When the first line segment is a plurality of lines and/or the second line segment is a plurality of lines, the obtained first distance is a plurality of lines.
Step S142: and determining a reference line according to the first distance.
When the first distance is one, the corresponding line segments are a first line segment and a second line segment, the reference line is directly determined according to the second line segment, and the two end points of the reference line are further determined according to the two end points of the first line segment and the two end points of the second line segment. When the first distance is multiple, the corresponding first line segments are multiple and/or the corresponding second line segments are multiple, at this time, one line segment is selected from the multiple first line segments and one line segment is selected from the multiple second line segments according to the first distance, and the reference line and the corresponding two endpoints are determined according to the two selected line segments.
In an alternative embodiment, step S141 specifically includes:
step S1411: and taking the calculated distance between each first line segment and each second line segment as a second distance if the first line segments are multiple, and/or taking the calculated distance between each first line segment and each second line segment as a third distance if the second line segments are multiple.
Specifically, the second distance may be a plurality of shortest distances between the first line segment and the second line segment, including a vertical distance and a horizontal distance. Similarly, the third distance may be a plurality of shortest distances between the first line segment and the second line segment, including a vertical distance and a horizontal distance.
Step S1412: and selecting a minimum distance from the second distance and the third distance as the first distance.
When the first line segment is a plurality of lines and/or the second line segment is a plurality of lines, the minimum distance among all the calculated distances of the first line segment and the second line segment is taken as the first distance.
In an alternative embodiment, step S1412 specifically includes:
step A: and determining a corresponding third line segment from the plurality of first line segments according to the first distance, and determining a corresponding fourth line segment from the plurality of second line segments.
The first distance is the minimum distance, and two line segments with the minimum distance are determined according to the minimum distance, wherein one line segment is one line segment in a plurality of first line segments, and is marked as a third line segment, and the other line segment is one line segment in a plurality of second line segments, and is marked as a fourth line segment.
And (B) step (B): and determining the reference line according to the fourth line segment.
Specifically, a line corresponding to the second line segment may be used as the reference line. Or taking a line which is a preset distance from the second line segment as the reference line, wherein the reference line is positioned outside the first circumscribed rectangle and the second circumscribed rectangle. Taking the example shown in fig. 1b as an example, taking a reference line in a horizontal direction as a reference line, wherein a third line segment is a lower edge of a first external rectangle, two corresponding endpoints of the third line segment are (x 1, y 2) and (x 2, y 2) respectively, a fourth line segment is an upper edge of a second external rectangle, two corresponding endpoints of the fourth line segment are (x 3, y 3) and (x 4, y 3) respectively, and a line corresponding to the fourth line segment can be directly taken as the reference line, namely y=y3, and a straight line located above the fourth line segment by a preset distance is taken as the reference line.
Step C: and determining the end point of the reference line according to the end points of the third line segment and the fourth line segment.
Specifically, one end point of the reference line may be one of two end points of the third line segment, and the other end point of the reference line may be one of two end points of the fourth line segment. In particular which endpoint is determined by the specific locations of the third line segment and the fourth line segment.
And connecting the endpoints determined in the steps into a line to obtain the reference line, and drawing the reference line, wherein the line type, the color and the like which are preset can be used for drawing during drawing.
In an alternative embodiment, step C specifically includes:
step C1: and determining the orientations of the third line segment and the fourth line segment.
Specifically, the entire current editing page may be placed in a two-dimensional coordinate system, and coordinates of four vertices of the first circumscribed rectangle and coordinates of four vertices of the second circumscribed rectangle are determined in the two-dimensional coordinate system, where the third line segment is any one of four sides and two center lines of the first circumscribed rectangle, and the fourth line segment is any one of four sides and two center lines of the second circumscribed rectangle.
Since the coordinates of the four vertices of the first bounding rectangle and the coordinates of the four vertices of the second bounding rectangle are known, the coordinates of the two endpoints of the third line segment, that is, the position of the third line segment, can be determined according to the coordinates of the four vertices of the first bounding rectangle, and the coordinates of the two endpoints of the fourth line segment, that is, the position of the fourth line segment, can be determined according to the coordinates of the four vertices of the second bounding rectangle, and further, the positions of the third line segment and the fourth line segment can be determined according to the positions of the third line segment and the positions of the fourth line segment.
Step C2: and determining the end point of the reference line according to the azimuth, the end point of the third line segment and the end point of the fourth line segment.
Specifically, taking the example shown in fig. 1b as an example, taking a reference line in a horizontal direction as an example, wherein a third line segment is a lower edge of a first external rectangle, two corresponding endpoints of the third line segment are (x 1, y 2) and (x 2, y 2) respectively, a fourth line segment is an upper edge of a second external rectangle, two corresponding endpoints of the fourth line segment are (x 3, y 3) and (x 4, y 3) respectively, and according to coordinates of the two line segments, it can be determined that the first external rectangle is located at the upper left of the second external rectangle, and then it can be determined that a minimum value of x coordinate corresponding to an endpoint of the reference line is x1, and a maximum value of x4.
In an alternative embodiment, step C2 specifically includes:
step C21: and if the first distance is smaller than the preset distance, moving the third line segment to the fourth line segment according to the direction, so that the third line segment and the fourth line segment are overlapped.
Specifically, if the first distance is smaller than the preset distance, the first distance is the minimum distance (see the related step specifically), and the minimum distance is smaller than the preset distance, which indicates that the first web page element is slightly moved, and adsorption is more capable of being added here, that is, the third line segment is moved to the fourth line segment, so that the third line segment overlaps with the fourth line segment.
Taking fig. 1b as an example, the third line segment is the lower edge of the first external rectangle, two corresponding endpoints are (x 1, y 2) and (x 2, y 2) respectively, the fourth line segment is the upper edge of the second external rectangle, two corresponding endpoints are (x 3, y 3) and (x 4, y 3) respectively, and if the vertical distance between the two is smaller than the preset distance, the lower edge of the first external rectangle is moved to the upper edge of the second external rectangle, so that the lower edge of the first external rectangle is overlapped.
Step C22: and determining the end point of the reference line according to the end points of the overlapped line segments.
Specifically, a reference line and a corresponding endpoint are determined according to the line segments after the superposition. For example, the line segment after overlapping is used as a reference line. As shown in fig. 1b, the minimum value of the x coordinate corresponding to the end point of the reference line may be determined as x1, and the maximum value as x4.
It will be appreciated by those skilled in the art that obvious modifications (e.g., combinations of the listed modes) or equivalent substitutions may be made on the basis of the above-described embodiments.
In the foregoing, although the steps in the embodiments of the reference line processing method are described in the above order, it should be clear to those skilled in the art that the steps in the embodiments of the disclosure are not necessarily performed in the above order, but may be performed in reverse order, parallel, cross, etc., and other steps may be further added by those skilled in the art on the basis of the above steps, and these obvious modifications or equivalent alternatives should also be included in the protection scope of the disclosure and are not repeated herein.
The following is an embodiment of the disclosed apparatus, which may be used to perform steps implemented by an embodiment of the disclosed method, and for convenience of explanation, only those portions relevant to the embodiment of the disclosed method are shown, and specific technical details are not disclosed, referring to the embodiment of the disclosed method.
Example two
In order to solve the technical problem that the edited pages are disordered due to the fact that corresponding reference lines are more when page elements are more in the prior art, the embodiment of the disclosure provides a reference line processing device. The apparatus may perform the steps of the reference line processing method embodiment described in the first embodiment. As shown in fig. 2, the apparatus mainly includes: a web page element acquisition module 21, an external rectangle generation module 22, a line segment determination module 23 and a reference line determination module 24; wherein,
the webpage element obtaining module 21 is configured to obtain, as a reference webpage element, at least one second webpage element located in a current editing page according to a position change of a first webpage element in the current editing page in a webpage editor;
the circumscribed rectangle generating module 22 is configured to generate a first circumscribed rectangle according to the first webpage element, and generate a second circumscribed rectangle according to the reference webpage element;
the line segment determining module 23 is configured to determine a first line segment according to the first circumscribed rectangle, and determine a second line segment according to the second circumscribed rectangle;
the reference line determining module 24 is configured to determine a reference line according to the first line segment and the second line segment; wherein the reference line is a line segment.
Further, the reference line does not exceed the boundary line of the first circumscribed rectangle and/or the second circumscribed rectangle.
Further, the reference line determining module 24 includes: a distance determination unit 241 and a reference line determination unit 242; wherein,
the distance determining unit 241 is configured to determine a first distance between the line segments according to the first line segment and the second line segment;
the reference line determining unit 242 is configured to determine a reference line according to the first distance.
Further, the distance determining unit 241 is specifically configured to: taking the calculated distance between each first line segment and each second line segment as a second distance if the first line segments are multiple, and/or taking the calculated distance between each first line segment and each second line segment as a third distance if the second line segments are multiple; and selecting a minimum distance from the second distance and the third distance as the first distance.
Further, the reference line determining unit 242 is specifically configured to: determining a corresponding third line segment from the plurality of first line segments according to the first distance, and determining a corresponding fourth line segment from the plurality of second line segments; determining a reference line according to the fourth line segment; and determining the end point of the reference line according to the end points of the third line segment and the fourth line segment.
Further, the reference line determining unit 242 is specifically configured to: determining the orientations of the third line segment and the fourth line segment; and determining the end point of the reference line according to the azimuth, the end point of the third line segment and the end point of the fourth line segment.
Further, the reference line determining unit 242 is specifically configured to: if the first distance is smaller than the preset distance, the third line segment is moved to the fourth line segment according to the direction, and the third line segment is overlapped with the fourth line segment; and determining the end point of the reference line according to the end points of the overlapped line segments.
For detailed descriptions of the working principles, the technical effects, etc. of the reference line processing apparatus embodiment, reference may be made to the related descriptions in the foregoing reference line processing method embodiment, and details are not repeated herein.
Example IV
Referring now to fig. 3, a schematic diagram of an electronic device 300 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 3 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 3, the electronic device 300 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various suitable actions and processes in accordance with a program stored in a Read Only Memory (ROM) 302 or a program loaded from a storage means 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic apparatus 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
In general, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 308 including, for example, magnetic tape, hard disk, etc.; and communication means 309. The communication means 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. While fig. 3 shows an electronic device 300 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via a communication device 309, or installed from a storage device 308, or installed from a ROM 302. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing means 301.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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. In the context of this disclosure, a computer-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. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer 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 computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least one second webpage element positioned in a current editing page as a reference webpage element according to the position change of a first webpage element in the current editing page in a webpage editor; generating a first external rectangle according to the first webpage element, and generating a second external rectangle according to the reference webpage element; determining a first line segment according to the first circumscribed rectangle, and determining a second line segment according to the second circumscribed rectangle; determining a reference line according to the first line segment and the second line segment; wherein the reference line is a line segment.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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.
According to one or more embodiments of the present disclosure, there is provided a reference line processing method including:
acquiring at least one second webpage element positioned in a current editing page as a reference webpage element according to the position change of a first webpage element in the current editing page in a webpage editor;
generating a first external rectangle according to the first webpage element, and generating a second external rectangle according to the reference webpage element;
determining a first line segment according to the first circumscribed rectangle, and determining a second line segment according to the second circumscribed rectangle;
determining a reference line according to the first line segment and the second line segment; wherein the reference line is a line segment.
Further, the reference line does not exceed the boundary line of the first circumscribed rectangle and/or the second circumscribed rectangle.
Further, the determining a reference line according to the first line segment and the second line segment includes:
determining a first distance between the line segments according to the first line segment and the second line segment;
and determining a reference line according to the first distance.
Further, the determining the first distance between the line segments according to the first line segment and the second line segment includes:
Taking the calculated distance between each first line segment and each second line segment as a second distance if the first line segments are multiple, and/or taking the calculated distance between each first line segment and each second line segment as a third distance if the second line segments are multiple;
and selecting a minimum distance from the second distance and the third distance as the first distance.
Further, the determining a reference line according to the first distance includes:
determining a corresponding third line segment from the plurality of first line segments according to the first distance, and determining a corresponding fourth line segment from the plurality of second line segments;
determining a reference line according to the fourth line segment;
and determining the end point of the reference line according to the end points of the third line segment and the fourth line segment.
Further, the determining the end point of the reference line according to the end point of the third line segment and the end point of the fourth line segment includes:
determining the orientations of the third line segment and the fourth line segment;
and determining the end point of the reference line according to the azimuth, the end point of the third line segment and the end point of the fourth line segment.
Further, the determining the end point of the reference line according to the azimuth, the end point of the third line segment and the end point of the fourth line segment includes:
If the first distance is smaller than the preset distance, the third line segment is moved to the fourth line segment according to the direction, and the third line segment is overlapped with the fourth line segment;
and determining the end point of the reference line according to the end points of the overlapped line segments.
According to one or more embodiments of the present disclosure, there is provided a reference line processing apparatus including:
the webpage element acquisition module is used for acquiring at least one second webpage element positioned in the current editing page as a reference webpage element according to the position change of the first webpage element in the current editing page in the webpage editor;
the external rectangle generation module is used for generating a first external rectangle according to the first webpage element and generating a second external rectangle according to the reference webpage element;
the line segment determining module is used for determining a first line segment according to the first circumscribed rectangle and determining a second line segment according to the second circumscribed rectangle;
the reference line determining module is used for determining a reference line according to the first line segment and the second line segment; wherein the reference line is a line segment.
Further, the reference line does not exceed the boundary line of the first circumscribed rectangle and/or the second circumscribed rectangle.
Further, the reference line determining module includes:
a distance determining unit, configured to determine a first distance between line segments according to the first line segment and the second line segment;
and the reference line determining unit is used for determining a reference line according to the first distance.
Further, the distance determining unit is specifically configured to: taking the calculated distance between each first line segment and each second line segment as a second distance if the first line segments are multiple, and/or taking the calculated distance between each first line segment and each second line segment as a third distance if the second line segments are multiple; and selecting a minimum distance from the second distance and the third distance as the first distance.
Further, the reference line determining unit is specifically configured to: determining a corresponding third line segment from the plurality of first line segments according to the first distance, and determining a corresponding fourth line segment from the plurality of second line segments; determining a reference line according to the fourth line segment; and determining the end point of the reference line according to the end points of the third line segment and the fourth line segment.
Further, the reference line determining unit is specifically configured to: determining the orientations of the third line segment and the fourth line segment; and determining the end point of the reference line according to the azimuth, the end point of the third line segment and the end point of the fourth line segment.
Further, the reference line determining unit is specifically configured to: if the first distance is smaller than the preset distance, the third line segment is moved to the fourth line segment according to the direction, and the third line segment is overlapped with the fourth line segment; and determining the end point of the reference line according to the end points of the overlapped line segments.
According to one or more embodiments of the present disclosure, there is provided an electronic device including:
a memory for storing non-transitory computer readable instructions; and
and a processor configured to execute the computer readable instructions, such that the processor performs the reference line processing method described above.
According to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium storing non-transitory computer-readable instructions that, when executed by a computer, cause the computer to perform the above-described reference line processing method.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (8)

1. A reference line processing method, comprising:
acquiring at least one second webpage element positioned in a current editing page as a reference webpage element according to the position change of a first webpage element in the current editing page in a webpage editor;
Generating a first external rectangle according to the first webpage element, and generating a second external rectangle according to the reference webpage element;
determining a first line segment according to the first circumscribed rectangle, and determining a second line segment according to the second circumscribed rectangle;
determining a reference line according to the first line segment and the second line segment; wherein the reference line is a line segment; the reference lines comprise horizontal reference lines and/or vertical reference lines; the reference line does not exceed the boundary line of the first circumscribed rectangle and/or the second circumscribed rectangle;
the reference line is determined according to a first distance;
the first distance is determined by:
taking the calculated distance between each first line segment and each second line segment as a second distance if the first line segments are multiple, and/or taking the calculated distance between each first line segment and each second line segment as a third distance if the second line segments are multiple;
and selecting a minimum distance from the second distance and the third distance as the first distance.
2. The method of claim 1, wherein the determining a reference line from the first line segment and the second line segment comprises:
Determining a first distance between the line segments according to the first line segment and the second line segment;
and determining a reference line according to the first distance.
3. The method of claim 1, wherein said determining a reference line from said first distance comprises:
determining a corresponding third line segment from the plurality of first line segments according to the first distance, and determining a corresponding fourth line segment from the plurality of second line segments;
determining a reference line according to the fourth line segment;
and determining the end point of the reference line according to the end points of the third line segment and the fourth line segment.
4. A method according to claim 3, wherein said determining the end point of the reference line from the end points of the third line segment and the fourth line segment comprises:
determining the orientations of the third line segment and the fourth line segment;
and determining the end point of the reference line according to the azimuth, the end point of the third line segment and the end point of the fourth line segment.
5. The method of claim 4, wherein the determining the end point of the reference line from the bearing, the end point of the third line segment, and the end point of the fourth line segment comprises:
If the first distance is smaller than the preset distance, the third line segment is moved to the fourth line segment according to the direction, and the third line segment is overlapped with the fourth line segment;
and determining the end point of the reference line according to the end points of the overlapped line segments.
6. A reference line processing apparatus, comprising:
the webpage element acquisition module is used for acquiring at least one second webpage element positioned in the current editing page as a reference webpage element according to the position change of the first webpage element in the current editing page in the webpage editor;
the external rectangle generation module is used for generating a first external rectangle according to the first webpage element and generating a second external rectangle according to the reference webpage element;
the line segment determining module is used for determining a first line segment according to the first circumscribed rectangle and determining a second line segment according to the second circumscribed rectangle;
the reference line determining module is used for determining a reference line according to the first line segment and the second line segment; wherein the reference line is a line segment; the reference lines comprise horizontal reference lines and/or vertical reference lines; the reference line does not exceed the boundary line of the first circumscribed rectangle and/or the second circumscribed rectangle;
The reference line is determined according to a first distance;
the first distance is determined by:
taking the calculated distance between each first line segment and each second line segment as a second distance if the first line segments are multiple, and/or taking the calculated distance between each first line segment and each second line segment as a third distance if the second line segments are multiple;
and selecting a minimum distance from the second distance and the third distance as the first distance.
7. An electronic device, comprising:
a memory for storing non-transitory computer readable instructions; and a processor for executing the computer readable instructions such that the processor, when executed, implements the reference line processing method according to any one of claims 1-5.
8. A computer readable storage medium storing non-transitory computer readable instructions which, when executed by a computer, cause the computer to perform the reference line processing method of any one of claims 1-5.
CN202010533065.8A 2020-06-12 2020-06-12 Reference line processing method and device Active CN111753230B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010533065.8A CN111753230B (en) 2020-06-12 2020-06-12 Reference line processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010533065.8A CN111753230B (en) 2020-06-12 2020-06-12 Reference line processing method and device

Publications (2)

Publication Number Publication Date
CN111753230A CN111753230A (en) 2020-10-09
CN111753230B true CN111753230B (en) 2023-12-19

Family

ID=72676055

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010533065.8A Active CN111753230B (en) 2020-06-12 2020-06-12 Reference line processing method and device

Country Status (1)

Country Link
CN (1) CN111753230B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105446647A (en) * 2015-12-25 2016-03-30 智慧方舟科技有限公司 E-ink book and reading note implementation method and device thereof
CN106201201A (en) * 2016-07-07 2016-12-07 广州视睿电子科技有限公司 view adjusting method and system
CN107220933A (en) * 2017-05-11 2017-09-29 上海联影医疗科技有限公司 A kind of reference line determines method and system
CN108319264A (en) * 2017-12-28 2018-07-24 北京臻迪科技股份有限公司 Navigation control method, device
CN110189319A (en) * 2019-05-31 2019-08-30 北京百度网讯科技有限公司 Supporter dividing method, device, equipment and storage medium
CN111104036A (en) * 2019-11-21 2020-05-05 广州视源电子科技股份有限公司 Element control method, device, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4665933B2 (en) * 2006-07-04 2011-04-06 セイコーエプソン株式会社 Document editing support apparatus, program, and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105446647A (en) * 2015-12-25 2016-03-30 智慧方舟科技有限公司 E-ink book and reading note implementation method and device thereof
CN106201201A (en) * 2016-07-07 2016-12-07 广州视睿电子科技有限公司 view adjusting method and system
CN107220933A (en) * 2017-05-11 2017-09-29 上海联影医疗科技有限公司 A kind of reference line determines method and system
CN108319264A (en) * 2017-12-28 2018-07-24 北京臻迪科技股份有限公司 Navigation control method, device
CN110189319A (en) * 2019-05-31 2019-08-30 北京百度网讯科技有限公司 Supporter dividing method, device, equipment and storage medium
CN111104036A (en) * 2019-11-21 2020-05-05 广州视源电子科技股份有限公司 Element control method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN111753230A (en) 2020-10-09

Similar Documents

Publication Publication Date Title
CN112184738B (en) Image segmentation method, device, equipment and storage medium
CN112053286B (en) Image processing method, device, electronic equipment and readable medium
CN111259636B (en) Document rendering method and device and electronic equipment
CN110795196A (en) Window display method, device, terminal and storage medium
CN111461968B (en) Picture processing method, device, electronic equipment and computer readable medium
CN113205601B (en) Roaming path generation method and device, storage medium and electronic equipment
CN111258582B (en) Window rendering method and device, computer equipment and storage medium
CN111753230B (en) Reference line processing method and device
CN111563214B (en) Reference line processing method and device
CN111273884A (en) Image display method and device and electronic equipment
CN113255812B (en) Video frame detection method and device and electronic equipment
CN111338827B (en) Method and device for pasting form data and electronic equipment
CN110807164B (en) Automatic image area adjusting method and device, electronic equipment and computer readable storage medium
CN114419298A (en) Virtual object generation method, device, equipment and storage medium
CN112445394B (en) Screenshot method and screenshot device
CN113672122A (en) Image processing method and device and electronic equipment
CN112395826B (en) Text special effect processing method and device
CN110796144A (en) License plate detection method, device, equipment and storage medium
CN114911564B (en) Page movement processing method, device, equipment and storage medium
CN110618776A (en) Picture scaling method, device, equipment and storage medium
CN114066721B (en) Display method and device and electronic equipment
CN114327188B (en) Form layout method, form layout device, electronic equipment and computer readable medium
CN114357348B (en) Display method and device and electronic equipment
CN113835792B (en) Method and device for drawing page element
US20230300385A1 (en) Image processing method and apparatus

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
GR01 Patent grant
GR01 Patent grant