This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn nearest_point_within_rounded_rect( | |
point: Pos2, | |
rect: Rect, | |
corner_radius: f32, | |
) -> Pos2 { | |
let mut x = point.x; | |
let mut y = point.y; | |
// Check if point is inside or outside the rounded corners | |
let mut in_top_left_corner = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Definition for a binary tree node. | |
* public class TreeNode { | |
* public var val: Int | |
* public var left: TreeNode? | |
* public var right: TreeNode? | |
* public init(_ val: Int) { | |
* self.val = val | |
* self.left = nil | |
* self.right = nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// EmbarkStore.swift | |
// test | |
// | |
// Created by Sam Pettersson on 2020-01-16. | |
// | |
import Foundation | |
import Flow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getNodeByAttribute = function (attribute, page) { | |
var nodeIteratorUtil = require("NodeIteratorUtil"); | |
var nodeFilterUtil = require("NodeFilterUtil"); | |
var resourceLocatorUtil = require("ResourceLocatorUtil"); | |
var propertyUtil = require("PropertyUtil"); | |
var attributeFilter = nodeFilterUtil.getStringPropertyFilter("attribute", attribute); | |
if (page === void 0) { | |
page = resourceLocatorUtil.getSitePage(); | |
} |