CN111563214A - Reference line processing method and device - Google Patents

Reference line processing method and device Download PDF

Info

Publication number
CN111563214A
CN111563214A CN202010357127.4A CN202010357127A CN111563214A CN 111563214 A CN111563214 A CN 111563214A CN 202010357127 A CN202010357127 A CN 202010357127A CN 111563214 A CN111563214 A CN 111563214A
Authority
CN
China
Prior art keywords
point
reference line
determining
distance
webpage element
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.)
Granted
Application number
CN202010357127.4A
Other languages
Chinese (zh)
Other versions
CN111563214B (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 CN202010357127.4A priority Critical patent/CN111563214B/en
Publication of CN111563214A publication Critical patent/CN111563214A/en
Application granted granted Critical
Publication of CN111563214B publication Critical patent/CN111563214B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

Landscapes

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

Abstract

The disclosure discloses a reference line processing method, a reference line processing device, an electronic device and a computer-readable storage medium. The method comprises the following steps: 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 point according to the first circumscribed rectangle, and determining a second point according to the reference webpage element; and determining a reference line according to the first point and the second point, wherein the reference line is a line segment. According to the method and the device, the reference line is determined to be the line segment through the points in the circumscribed rectangle, so that confusion of the corresponding reference line when more page elements exist in the page to be edited can be avoided, and the relation between the circumscribed rectangle and the circumscribed rectangle does not need to be considered.

Description

Reference line processing method and device
Technical Field
The present disclosure relates to the field of browser technologies, and in particular, to a reference line processing method and apparatus, and a computer-readable storage medium.
Background
A web page is a basic element constituting a website, and is a platform for carrying various website applications. Specifically, the web page is a plain Text file containing hypertext Markup Language (HTML) tags. The text and the picture are two most basic elements forming a webpage, and the elements of the webpage further 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 above-mentioned various elements are added to the web page by using the HTML editor. When adding elements through an HTML editor, it is often necessary to use reference lines to assist in the positioning or alignment of the elements.
However, in the prior art, the reference line drawn by the HTML editor is generally a straight line without a boundary, and when there are many page elements, there are many corresponding reference lines, which may confuse the edited 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 to be solved by the present disclosure is to provide a reference line processing method, so as to at least partially solve the technical problem that when there are many page elements in the prior art, there are many corresponding reference lines, which may cause the edited page to be disordered. In addition, a reference line processing apparatus, a reference line processing hardware apparatus, a computer-readable storage medium, and a reference line processing terminal are also provided.
In order to achieve the above object, according to one aspect of the present disclosure, the following technical solutions are provided:
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 point according to the first external rectangle, and determining a second point according to the second external rectangle;
determining a reference line according to the first point and the second point; wherein the reference line is a line segment.
In order to achieve the above object, according to one aspect of the present disclosure, the following technical solutions are provided:
a reference line processing apparatus comprising:
the webpage element acquisition module is used for 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;
the circumscribed rectangle generating module is used for generating a first circumscribed rectangle according to the first webpage element and generating a second circumscribed rectangle according to the reference webpage element;
the point determining module is used for determining a first point according to the first external rectangle and determining a second point according to the second external rectangle;
a reference line determining module, configured to determine a reference line according to the first point and the second point; wherein the reference line is a line segment.
In order to achieve the above object, according to one aspect of the present disclosure, the following technical solutions are provided:
an electronic device, comprising:
a memory for storing non-transitory computer readable instructions; and
a processor for executing the computer readable instructions, so that the processor implements any of the above reference line processing methods when executed.
In order to achieve the above object, according to one aspect of the present disclosure, the following technical solutions are provided:
a computer readable storage medium storing non-transitory computer readable instructions which, when executed by a computer, cause the computer to perform any of the reference line processing methods described above.
In order to achieve the above object, according to still another aspect of the present disclosure, the following technical solutions are also provided:
a reference line processing terminal comprises any one of the reference line processing devices.
According to the method and the device for editing the webpage elements, at least one second webpage element located in the current editing page is obtained to serve as a reference webpage element according to the position change of a first webpage element in the current editing page in a 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 point is determined according to the first external rectangle, a second point is determined according to the second external rectangle, a reference line is determined according to the first point and the second point, the reference line is a line segment, and therefore the reference line is determined to be the line segment through the points in the external rectangle, the corresponding reference line can be prevented from being disordered when the number of the webpage elements in the editing page is large, and the relation between the external rectangle and the external rectangle is not needed to be considered.
The foregoing is a summary of the present disclosure, and for the purposes of promoting a clear understanding of the technical means of the present disclosure, the present disclosure may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is a schematic flow diagram of a reference line processing method according to one embodiment of the present disclosure;
FIG. 2 is a schematic structural diagram of a reference line processing apparatus according to one embodiment of the present disclosure;
fig. 3 is a schematic structural diagram 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 are shown in the 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 rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the 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. Moreover, 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 "include" and variations thereof as used herein are 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". Relevant definitions for other terms will be given in the following description.
Example one
In order to solve the technical problem that in the prior art, when a number of page elements is large, corresponding reference lines are also large, and an edited page is relatively disordered, an embodiment of the present disclosure provides a reference line processing method. As shown in fig. 1, 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 a first webpage element in the current editing page in the webpage editor.
To distinguish between different web page elements, a web page element whose position has changed is defined herein as a first web page element, and a reference web page element of the first web page element is defined herein as a second web page element. The first webpage element and the second webpage element can be characters, pictures, audios, videos, animations, 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 (HTML) editor, such as an HTML5 editor.
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 acquired as a reference webpage element. The change in the position of the first web page element may be represented as a movement or a deformation of the first web page element, for example, a user drags the first web page element in a current editing page, so that the first web page element is moved or deformed.
The deformation scene of the first webpage element comprises dragging any side or any vertex of the first circumscribed rectangle, so that the first circumscribed rectangle is deformed (for example, the first circumscribed rectangle is enlarged or reduced, and may or may not be in equal proportion).
Step S12: and generating a first external rectangle according to the first webpage element, and generating a second external rectangle according to the reference webpage element.
In order to distinguish the circumscribed rectangles of different web page elements, the circumscribed rectangle corresponding to the first web page element is defined as a first circumscribed rectangle, and the circumscribed rectangle corresponding to the second web page element is defined as a second circumscribed rectangle.
The webpage element is contained inside the circumscribed rectangle, and the circumscribed rectangle may be a minimum circumscribed rectangle, that is, a maximum range of a two-dimensional shape (e.g., a circle, a point, a polygon) corresponding to the webpage element expressed by two-dimensional coordinates, specifically, a rectangle whose boundary is determined by a maximum abscissa, a minimum abscissa, a maximum ordinate, and a minimum ordinate of each vertex of a given two-dimensional shape.
Step S13: and determining a first point according to the first external rectangle, and determining a second point according to the second external rectangle.
The first point may be one or more, and specifically may be a point or a center point on four sides of the first circumscribed rectangle, where the points on the four sides may specifically be four vertices (including an upper left point, a lower left point, an upper right point, and a lower right point). Similarly, the second point may also be one or more, and specifically may be a point or a central point on four sides of the second circumscribed rectangle, where the points on the four sides may specifically be four vertices (including an upper left point, a lower left point, an upper right point, and a lower right point).
Step S14: determining a reference line according to the first point and the second point; wherein the reference line is a line segment.
Wherein the reference line comprises a horizontal reference line and/or a vertical reference line.
Wherein the reference line does not exceed a boundary line of the first circumscribed rectangle and/or the second circumscribed rectangle.
In the embodiment, at least one second webpage element in the current editing page is acquired as a reference webpage element according to the position change of a first webpage element in the current editing page in a 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 point is determined according to the first external rectangle, a second point is determined according to the second external rectangle, a reference line is determined according to the first point and the second point, the reference line is a line segment, and therefore the reference line is determined to be the line segment through points in the external rectangle, confusion of the reference line corresponding to more page elements in the editing page can be avoided, and the relation between the external rectangle and the external rectangle does not need to be considered.
In an optional embodiment, step S14 specifically includes:
step S141: a first distance between points is determined from the first point and the second point.
When the first point and the second point are both one, the obtained first distance is also one, that is, the distance between the first point and the second point, and specifically, the distance from the first point to the second point in the x direction or the y direction may be used. When the first point is multiple and/or the second point is multiple, the obtained first distance is also multiple.
Step S142: and determining a reference line according to the first distance.
When the first distance is one, the corresponding points are the first point and the second point, the reference line is directly determined according to the second point, and two end points of the reference line are further determined. When the first distance is multiple, the corresponding first point is multiple and/or the corresponding second point is multiple, and at this time, one point needs to be selected from the multiple first points and one point needs to be selected from the multiple second points according to the first distance, and the reference line and the two corresponding endpoints are determined according to the two selected points.
In an optional embodiment, step S141 specifically includes:
step S1411: and if the first points are multiple, taking the calculated distance between each first point and each second point as a second distance, and/or if the second points are multiple, taking the calculated distance between each first point and each second point as a third distance.
Specifically, the second distance is plural, and specifically, the distance from the first point to the second point in the x direction or the y direction may be. Similarly, the third distance is also plural, and specifically may be a distance from the first point to the second point in the x direction or the y direction.
Step S1412: selecting a minimum distance from the second distance and the third distance as the first distance.
And when the first point and/or the second point are multiple, taking the minimum distance of all the distances between the first point and the second point as the first distance.
In an optional embodiment, step S1412 specifically includes:
step A: and determining a corresponding third point from the plurality of first points according to the first distance, and determining a corresponding fourth point from the plurality of second points.
Wherein the first distance is a minimum distance, and two points having the minimum distance are determined according to the minimum distance, wherein one point is one of the first points, herein denoted as a third point, and wherein the other point is one of the second points, herein denoted as a fourth point.
And B: and determining the reference line according to the third point and the fourth point.
The reference line is drawn after the reference line is obtained, and the reference line may be drawn by using a preset line type, color, or the like.
In an optional embodiment, step B specifically includes:
step B1: and if the first distance is smaller than a preset distance, determining the reference line according to the coordinate of the third point and the coordinate of the fourth point.
Specifically, the entire current editing page may be placed in a two-dimensional coordinate system, and the coordinates of a point corresponding to the first circumscribed rectangle and the coordinates of a point corresponding to the second circumscribed rectangle are determined in the two-dimensional coordinate system, where the third point is any one of the corresponding points of the first circumscribed rectangle, and the fourth point is any one of the corresponding points of the second circumscribed rectangle.
Since the coordinates of the corresponding point of the first circumscribed rectangle and the coordinates of the corresponding point of the second circumscribed rectangle are known, the coordinates of the two end points of the third point can be determined according to the coordinates of the corresponding point of the first circumscribed rectangle, and the coordinates of the two end points of the fourth point can be determined according to the coordinates of the corresponding point of the second circumscribed rectangle.
In an alternative embodiment, step B1 specifically includes:
step B11: determining a fifth point according to the coordinates of the third point and the coordinates of the fourth point; wherein the x coordinate of the fifth point is the same as the x coordinate of the fourth point or the y coordinate of the fifth point is the same as the y coordinate of the fourth point.
Step B12: a line passing through the fifth point and the fourth point is taken as the reference line.
Step B13: and acquiring a point with the minimum coordinate value and a point with the maximum coordinate value along the reference line as two end points of the reference line respectively.
Specifically, taking the determination of a reference line in the horizontal direction as an example, the y coordinate of the third point is set to be the y coordinate of the fourth point to obtain a fifth point, then a line passing through the fifth point and the fourth point is taken as the reference line, finally, the points on the first circumscribed rectangle and the second circumscribed rectangle included in the reference line are determined, and then, the point with the minimum coordinate value and the point with the maximum coordinate value are selected as the two end points of the reference line respectively. Similarly, when a reference line in the vertical direction is determined, setting the x coordinate of the third point as the x coordinate of the fourth point to obtain a fifth point, then taking a line passing through the fifth point and the fourth point as the reference line, finally determining the points on the first external rectangle and the second external rectangle contained in the reference line, and then selecting the point with the minimum coordinate value and the point with the maximum coordinate value as two end points of the reference line respectively
It will be appreciated by those skilled in the art that obvious modifications (e.g., combinations of the enumerated modes) or equivalents may be made to the above-described embodiments.
In the above, although the steps in the embodiment of the reference line processing method are described in the above sequence, it should be clear to those skilled in the art that the steps in the embodiment of the present disclosure are not necessarily performed in the above sequence, and may also be performed in other sequences such as reverse, parallel, and cross, and further, on the basis of the above steps, those skilled in the art may also add other steps, and these obvious modifications or equivalents should also be included in the protection scope of the present disclosure, and are not described herein again.
For convenience of description, only the relevant parts of the embodiments of the present disclosure are shown, and details of the specific techniques are not disclosed, please refer to the embodiments of the method of the present disclosure.
Example two
In order to solve the technical problem that in the prior art, when a number of page elements is large, corresponding reference lines are also large, and an edited page is relatively disordered, an embodiment of the present disclosure provides a reference line processing apparatus. The apparatus may perform the steps in the reference line processing method embodiment described in the first embodiment. As shown in fig. 2, the apparatus mainly includes: the system comprises a webpage element acquisition module 21, an external rectangle generation module 22, a point determination module 23 and a reference line determination module 24; wherein the content of the first and second substances,
the webpage element acquiring module 21 is configured to acquire at least one second webpage element located in a current editing page as a reference webpage element 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 point determining module 23 is configured to determine a first point according to the first external rectangle, and determine a second point according to the second external rectangle;
the reference line determining module 24 is configured to determine a reference line according to the first point and the second point; 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 content of the first and second substances,
the distance determining unit 241 is configured to determine a first distance between points according to the first point and the second point;
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: if the first points are multiple, taking the calculated distance between each first point and each second point as a second distance, and/or if the second points are multiple, taking the calculated distance between each first point and each second point as a third distance; 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 point from the plurality of first points according to the first distance, and determining a corresponding fourth point from the plurality of second points; and determining a reference line according to the third point and the fourth point.
Further, the reference line determining unit 242 is specifically configured to: and if the first distance is smaller than a preset distance, determining the reference line according to the coordinate of the third point and the coordinate of the fourth point.
Further, the reference line determining unit 242 is specifically configured to: determining a fifth point according to the coordinates of the third point and the coordinates of the fourth point; wherein the x coordinate of the fifth point is the same as the x coordinate of the fourth point or the y coordinate of the fifth point is the same as the y coordinate of the fourth point; taking a line passing through the fifth point and the fourth point as the reference line; and acquiring a point with the minimum coordinate value and a point with the maximum coordinate value along the reference line as two end points of the reference line respectively.
For detailed descriptions of the working principle, the technical effect of implementation, and the like of the embodiment of the reference line processing apparatus, reference may be made to the description of the embodiment of the reference line processing method, which is not repeated herein.
Example four
Referring now to FIG. 3, a block diagram of an electronic device 300 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
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 appropriate 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 necessary 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.
Generally, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touch pad, 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 devices 308 including, for example, magnetic tape, hard disk, etc.; and a communication device 309. The communication means 309 may allow the electronic device 300 to communicate wirelessly or by wire with other devices to exchange data. While fig. 3 illustrates an electronic device 300 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 309, or installed from the storage means 308, or installed from the ROM 302. The computer program, when executed by the processing device 301, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer 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 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 present 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 contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either 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 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, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, 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 communications 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 network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled 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 point according to the first external rectangle, and determining a second point according to the second external rectangle; determining a reference line according to the first point and the second point; wherein the reference line is a line segment.
Computer program code for carrying out operations for the present disclosure may be written in any combination of 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 type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart 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 described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
The functions described herein above 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: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), 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. A 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 point according to the first external rectangle, and determining a second point according to the second external rectangle;
determining a reference line according to the first point and the second point; 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 point and the second point includes:
determining a first distance between points from the first point and the second point;
and determining a reference line according to the first distance.
Further, said determining a first distance between points based on said first point and said second point comprises:
if the first points are multiple, taking the calculated distance between each first point and each second point as a second distance, and/or if the second points are multiple, taking the calculated distance between each first point and each second point as a third distance;
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 point from the plurality of first points according to the first distance, and determining a corresponding fourth point from the plurality of second points;
and determining a reference line according to the third point and the fourth point.
Further, the determining the reference line according to the third point and the fourth point includes:
and if the first distance is smaller than a preset distance, determining the reference line according to the coordinate of the third point and the coordinate of the fourth point.
Further, the determining the reference line according to the coordinates of the third point and the coordinates of the fourth point includes:
determining a fifth point according to the coordinates of the third point and the coordinates of the fourth point; wherein the x coordinate of the fifth point is the same as the x coordinate of the fourth point or the y coordinate of the fifth point is the same as the y coordinate of the fourth point;
taking a line passing through the fifth point and the fourth point as the reference line;
and acquiring a point with the minimum coordinate value and a point with the maximum coordinate value along the reference line as two end points of the reference line respectively.
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 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;
the circumscribed rectangle generating module is used for generating a first circumscribed rectangle according to the first webpage element and generating a second circumscribed rectangle according to the reference webpage element;
the point determining module is used for determining a first point according to the first external rectangle and determining a second point according to the second external rectangle;
a reference line determining module, configured to determine a reference line according to the first point and the second point; 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 determination module includes:
a distance determining unit for determining a first distance between points based on the first point and the second point;
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: if the first points are multiple, taking the calculated distance between each first point and each second point as a second distance, and/or if the second points are multiple, taking the calculated distance between each first point and each second point as a third distance; 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 point from the plurality of first points according to the first distance, and determining a corresponding fourth point from the plurality of second points; and determining a reference line according to the third point and the fourth point.
Further, the reference line determining unit is specifically configured to: and if the first distance is smaller than a preset distance, determining the reference line according to the coordinate of the third point and the coordinate of the fourth point.
Further, the reference line determining unit is specifically configured to: determining a fifth point according to the coordinates of the third point and the coordinates of the fourth point; wherein the x coordinate of the fifth point is the same as the x coordinate of the fourth point or the y coordinate of the fifth point is the same as the y coordinate of the fourth point; taking a line passing through the fifth point and the fourth point as the reference line; and acquiring a point with the minimum coordinate value and a point with the maximum coordinate value along the reference line as two end points of the reference line respectively.
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 the processor is used for executing the computer readable instructions, so that the processor realizes the reference line processing method when executing.
According to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium storing non-transitory computer-readable instructions which, when executed by a computer, cause the computer to perform the above-described reference line processing method.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while 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. Under 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 limitations on the scope of the 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 disclosed as example forms of implementing the claims.

Claims (10)

1. A reference line processing method is characterized by comprising the following steps:
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 point according to the first external rectangle, and determining a second point according to the second external rectangle;
determining a reference line according to the first point and the second point; wherein the reference line is a line segment.
2. The method according to claim 1, wherein the reference line does not exceed a boundary line of the first circumscribing rectangle and/or the second circumscribing rectangle.
3. The method of claim 1, wherein determining a reference line from the first point and the second point comprises:
determining a first distance between points from the first point and the second point;
and determining a reference line according to the first distance.
4. The method of claim 3, wherein determining a first distance between points from the first point and the second point comprises:
if the first points are multiple, taking the calculated distance between each first point and each second point as a second distance, and/or if the second points are multiple, taking the calculated distance between each first point and each second point as a third distance;
selecting a minimum distance from the second distance and the third distance as the first distance.
5. The method of claim 4, wherein determining a reference line from the first distance comprises:
determining a corresponding third point from the plurality of first points according to the first distance, and determining a corresponding fourth point from the plurality of second points;
and determining the reference line according to the third point and the fourth point.
6. The method of claim 5, wherein said determining said reference line from said third point and said fourth point comprises:
and if the first distance is smaller than a preset distance, determining the reference line according to the coordinate of the third point and the coordinate of the fourth point.
7. The method of claim 6, wherein said determining the reference line from the coordinates of the third point and the coordinates of the fourth point comprises:
determining a fifth point according to the coordinates of the third point and the coordinates of the fourth point; wherein the x coordinate of the fifth point is the same as the x coordinate of the fourth point or the y coordinate of the fifth point is the same as the y coordinate of the fourth point;
taking a line passing through the fifth point and the fourth point as the reference line;
and acquiring a point with the minimum coordinate value and a point with the maximum coordinate value along the reference line as two end points of the reference line respectively.
8. A reference line processing apparatus, comprising:
the webpage element acquisition module is used for 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;
the circumscribed rectangle generating module is used for generating a first circumscribed rectangle according to the first webpage element and generating a second circumscribed rectangle according to the reference webpage element;
the point determining module is used for determining a first point according to the first external rectangle and determining a second point according to the second external rectangle;
a reference line determining module, configured to determine a reference line according to the first point and the second point; wherein the reference line is a line segment.
9. 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 executing implements the reference line processing method according to any of claims 1-7.
10. A computer-readable storage medium storing non-transitory computer-readable instructions that, when executed by a computer, cause the computer to perform the reference line processing method of any one of claims 1-7.
CN202010357127.4A 2020-04-29 2020-04-29 Reference line processing method and device Active CN111563214B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010357127.4A CN111563214B (en) 2020-04-29 2020-04-29 Reference line processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010357127.4A CN111563214B (en) 2020-04-29 2020-04-29 Reference line processing method and device

Publications (2)

Publication Number Publication Date
CN111563214A true CN111563214A (en) 2020-08-21
CN111563214B CN111563214B (en) 2023-05-16

Family

ID=72074465

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010357127.4A Active CN111563214B (en) 2020-04-29 2020-04-29 Reference line processing method and device

Country Status (1)

Country Link
CN (1) CN111563214B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10222689A (en) * 1996-12-02 1998-08-21 Nippon Telegr & Teleph Corp <Ntt> Method for displaying graphic and device therefor and storage medium for storing graphic display program
CN106201201A (en) * 2016-07-07 2016-12-07 广州视睿电子科技有限公司 View method of adjustment and system
CN107220933A (en) * 2017-05-11 2017-09-29 上海联影医疗科技有限公司 A kind of reference line determines method and system
CN108734752A (en) * 2018-04-19 2018-11-02 阿里巴巴集团控股有限公司 Show the method, apparatus and electronic equipment of the data information in chart
CN110968987A (en) * 2018-09-30 2020-04-07 腾讯科技(深圳)有限公司 Table display method and device, storage medium and electronic device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10222689A (en) * 1996-12-02 1998-08-21 Nippon Telegr & Teleph Corp <Ntt> Method for displaying graphic and device therefor and storage medium for storing graphic display program
CN106201201A (en) * 2016-07-07 2016-12-07 广州视睿电子科技有限公司 View method of adjustment and system
CN107220933A (en) * 2017-05-11 2017-09-29 上海联影医疗科技有限公司 A kind of reference line determines method and system
CN108734752A (en) * 2018-04-19 2018-11-02 阿里巴巴集团控股有限公司 Show the method, apparatus and electronic equipment of the data information in chart
CN110968987A (en) * 2018-09-30 2020-04-07 腾讯科技(深圳)有限公司 Table display method and device, storage medium and electronic device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
向阳洁,何潇: "CorelDRAW在科技期刊制图中的应用" *

Also Published As

Publication number Publication date
CN111563214B (en) 2023-05-16

Similar Documents

Publication Publication Date Title
CN112184738B (en) Image segmentation method, device, equipment and storage medium
CN111399956A (en) Content display method and device applied to display equipment and electronic equipment
CN110298851B (en) Training method and device for human body segmentation neural network
CN111459364B (en) Icon updating method and device and electronic equipment
CN111784712B (en) Image processing method, device, equipment and computer readable medium
CN110825286B (en) Image processing method and device and electronic equipment
CN112053286B (en) Image processing method, device, electronic equipment and readable medium
CN111754600A (en) Poster image generation method and device and electronic equipment
CN114742934A (en) Image rendering method and device, readable medium and electronic equipment
CN110378282B (en) Image processing method and device
CN111259291B (en) View display method and device and electronic equipment
CN112445394B (en) Screenshot method and screenshot device
CN111258582A (en) Window rendering method and device, computer equipment and storage medium
CN111273884A (en) Image display method and device and electronic equipment
CN111324405A (en) Character display method and device and electronic equipment
CN113506356B (en) Method and device for drawing area map, readable medium and electronic equipment
CN113255812B (en) Video frame detection method and device and electronic equipment
CN111563214B (en) Reference line processing method and device
CN110262736B (en) Data table creating method and device
CN114419298A (en) Virtual object generation method, device, equipment and storage medium
CN113672122A (en) Image processing method and device and electronic equipment
CN111753230B (en) Reference line processing method and device
CN110618772B (en) View adding method, device, equipment and storage medium
CN113808238A (en) Animation rendering method and device, readable medium and electronic equipment
CN112395826B (en) Text special effect processing method and device

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