Demo/bin/Debug/front_end/elements/BezierUI.js

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

// Copyright (c) 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @constructor
 * @param {number} width
 * @param {number} height
 * @param {number} marginTop
 * @param {number} controlPointRadius
 * @param {boolean} linearLine
 */
WebInspector.BezierUI = function(width, height, marginTop, controlPointRadius, linearLine)
{
    this.width = width;
    this.height = height;
    this.marginTop = marginTop;
    this.radius = controlPointRadius;
    this.linearLine = linearLine;
}

WebInspector.BezierUI.prototype = {
    /**
     * @return {number}
     */
    curveWidth: function()
    {
        return this.width - this.radius * 2;
    },

    /**
     * @return {number}
     */
    curveHeight: function()
    {
        return this.height - this.radius * 2 - this.marginTop * 2;
    },

    /**
     * @param {!Element} parentElement
     * @param {string} className
     * @param {number} x1
     * @param {number} y1
     * @param {number} x2
     * @param {number} y2
     */
    _drawLine: function(parentElement, className, x1, y1, x2, y2)
    {
        var line = parentElement.createSVGChild("line", className);
        line.setAttribute("x1", x1 + this.radius);
        line.setAttribute("y1", y1 + this.radius + this.marginTop);
        line.setAttribute("x2", x2 + this.radius);
        line.setAttribute("y2", y2 + this.radius + this.marginTop);
    },

    /**
     * @param {!Element} parentElement
     * @param {number} startX
     * @param {number} startY
     * @param {number} controlX
后面还有 67 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。